169 #ifndef PY_SSIZE_T_CLEAN
170 #define PY_SSIZE_T_CLEAN
174 #error Python headers needed to compile C extensions, please install development version of Python.
175 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
176 #error Cython requires Python 2.6+ or Python 3.3+.
178 #define CYTHON_ABI "0_29_36"
179 #define CYTHON_HEX_VERSION 0x001D24F0
180 #define CYTHON_FUTURE_DIVISION 1
183 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
185 #if !defined(WIN32) && !defined(MS_WINDOWS)
197 #define DL_IMPORT(t) t
200 #define DL_EXPORT(t) t
202 #define __PYX_COMMA ,
203 #ifndef HAVE_LONG_LONG
204 #if PY_VERSION_HEX >= 0x02070000
205 #define HAVE_LONG_LONG
209 #define PY_LONG_LONG LONG_LONG
212 #define Py_HUGE_VAL HUGE_VAL
215 #define CYTHON_COMPILING_IN_PYPY 1
216 #define CYTHON_COMPILING_IN_PYSTON 0
217 #define CYTHON_COMPILING_IN_CPYTHON 0
218 #define CYTHON_COMPILING_IN_NOGIL 0
219 #undef CYTHON_USE_TYPE_SLOTS
220 #define CYTHON_USE_TYPE_SLOTS 0
221 #undef CYTHON_USE_PYTYPE_LOOKUP
222 #define CYTHON_USE_PYTYPE_LOOKUP 0
223 #if PY_VERSION_HEX < 0x03050000
224 #undef CYTHON_USE_ASYNC_SLOTS
225 #define CYTHON_USE_ASYNC_SLOTS 0
226 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
227 #define CYTHON_USE_ASYNC_SLOTS 1
229 #undef CYTHON_USE_PYLIST_INTERNALS
230 #define CYTHON_USE_PYLIST_INTERNALS 0
231 #undef CYTHON_USE_UNICODE_INTERNALS
232 #define CYTHON_USE_UNICODE_INTERNALS 0
233 #undef CYTHON_USE_UNICODE_WRITER
234 #define CYTHON_USE_UNICODE_WRITER 0
235 #undef CYTHON_USE_PYLONG_INTERNALS
236 #define CYTHON_USE_PYLONG_INTERNALS 0
237 #undef CYTHON_AVOID_BORROWED_REFS
238 #define CYTHON_AVOID_BORROWED_REFS 1
239 #undef CYTHON_ASSUME_SAFE_MACROS
240 #define CYTHON_ASSUME_SAFE_MACROS 0
241 #undef CYTHON_UNPACK_METHODS
242 #define CYTHON_UNPACK_METHODS 0
243 #undef CYTHON_FAST_THREAD_STATE
244 #define CYTHON_FAST_THREAD_STATE 0
245 #undef CYTHON_FAST_PYCALL
246 #define CYTHON_FAST_PYCALL 0
247 #if PY_VERSION_HEX < 0x03090000
248 #undef CYTHON_PEP489_MULTI_PHASE_INIT
249 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
250 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
251 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
253 #undef CYTHON_USE_TP_FINALIZE
254 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
255 #undef CYTHON_USE_DICT_VERSIONS
256 #define CYTHON_USE_DICT_VERSIONS 0
257 #undef CYTHON_USE_EXC_INFO_STACK
258 #define CYTHON_USE_EXC_INFO_STACK 0
259 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
260 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
262 #elif defined(PYSTON_VERSION)
263 #define CYTHON_COMPILING_IN_PYPY 0
264 #define CYTHON_COMPILING_IN_PYSTON 1
265 #define CYTHON_COMPILING_IN_CPYTHON 0
266 #define CYTHON_COMPILING_IN_NOGIL 0
267 #ifndef CYTHON_USE_TYPE_SLOTS
268 #define CYTHON_USE_TYPE_SLOTS 1
270 #undef CYTHON_USE_PYTYPE_LOOKUP
271 #define CYTHON_USE_PYTYPE_LOOKUP 0
272 #undef CYTHON_USE_ASYNC_SLOTS
273 #define CYTHON_USE_ASYNC_SLOTS 0
274 #undef CYTHON_USE_PYLIST_INTERNALS
275 #define CYTHON_USE_PYLIST_INTERNALS 0
276 #ifndef CYTHON_USE_UNICODE_INTERNALS
277 #define CYTHON_USE_UNICODE_INTERNALS 1
279 #undef CYTHON_USE_UNICODE_WRITER
280 #define CYTHON_USE_UNICODE_WRITER 0
281 #undef CYTHON_USE_PYLONG_INTERNALS
282 #define CYTHON_USE_PYLONG_INTERNALS 0
283 #ifndef CYTHON_AVOID_BORROWED_REFS
284 #define CYTHON_AVOID_BORROWED_REFS 0
286 #ifndef CYTHON_ASSUME_SAFE_MACROS
287 #define CYTHON_ASSUME_SAFE_MACROS 1
289 #ifndef CYTHON_UNPACK_METHODS
290 #define CYTHON_UNPACK_METHODS 1
292 #undef CYTHON_FAST_THREAD_STATE
293 #define CYTHON_FAST_THREAD_STATE 0
294 #undef CYTHON_FAST_PYCALL
295 #define CYTHON_FAST_PYCALL 0
296 #undef CYTHON_PEP489_MULTI_PHASE_INIT
297 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
298 #undef CYTHON_USE_TP_FINALIZE
299 #define CYTHON_USE_TP_FINALIZE 0
300 #undef CYTHON_USE_DICT_VERSIONS
301 #define CYTHON_USE_DICT_VERSIONS 0
302 #undef CYTHON_USE_EXC_INFO_STACK
303 #define CYTHON_USE_EXC_INFO_STACK 0
304 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
305 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
307 #elif defined(PY_NOGIL)
308 #define CYTHON_COMPILING_IN_PYPY 0
309 #define CYTHON_COMPILING_IN_PYSTON 0
310 #define CYTHON_COMPILING_IN_CPYTHON 0
311 #define CYTHON_COMPILING_IN_NOGIL 1
312 #ifndef CYTHON_USE_TYPE_SLOTS
313 #define CYTHON_USE_TYPE_SLOTS 1
315 #undef CYTHON_USE_PYTYPE_LOOKUP
316 #define CYTHON_USE_PYTYPE_LOOKUP 0
317 #ifndef CYTHON_USE_ASYNC_SLOTS
318 #define CYTHON_USE_ASYNC_SLOTS 1
320 #undef CYTHON_USE_PYLIST_INTERNALS
321 #define CYTHON_USE_PYLIST_INTERNALS 0
322 #ifndef CYTHON_USE_UNICODE_INTERNALS
323 #define CYTHON_USE_UNICODE_INTERNALS 1
325 #undef CYTHON_USE_UNICODE_WRITER
326 #define CYTHON_USE_UNICODE_WRITER 0
327 #undef CYTHON_USE_PYLONG_INTERNALS
328 #define CYTHON_USE_PYLONG_INTERNALS 0
329 #ifndef CYTHON_AVOID_BORROWED_REFS
330 #define CYTHON_AVOID_BORROWED_REFS 0
332 #ifndef CYTHON_ASSUME_SAFE_MACROS
333 #define CYTHON_ASSUME_SAFE_MACROS 1
335 #ifndef CYTHON_UNPACK_METHODS
336 #define CYTHON_UNPACK_METHODS 1
338 #undef CYTHON_FAST_THREAD_STATE
339 #define CYTHON_FAST_THREAD_STATE 0
340 #undef CYTHON_FAST_PYCALL
341 #define CYTHON_FAST_PYCALL 0
342 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
343 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
345 #ifndef CYTHON_USE_TP_FINALIZE
346 #define CYTHON_USE_TP_FINALIZE 1
348 #undef CYTHON_USE_DICT_VERSIONS
349 #define CYTHON_USE_DICT_VERSIONS 0
350 #undef CYTHON_USE_EXC_INFO_STACK
351 #define CYTHON_USE_EXC_INFO_STACK 0
353 #define CYTHON_COMPILING_IN_PYPY 0
354 #define CYTHON_COMPILING_IN_PYSTON 0
355 #define CYTHON_COMPILING_IN_CPYTHON 1
356 #define CYTHON_COMPILING_IN_NOGIL 0
357 #ifndef CYTHON_USE_TYPE_SLOTS
358 #define CYTHON_USE_TYPE_SLOTS 1
360 #if PY_VERSION_HEX < 0x02070000
361 #undef CYTHON_USE_PYTYPE_LOOKUP
362 #define CYTHON_USE_PYTYPE_LOOKUP 0
363 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
364 #define CYTHON_USE_PYTYPE_LOOKUP 1
366 #if PY_MAJOR_VERSION < 3
367 #undef CYTHON_USE_ASYNC_SLOTS
368 #define CYTHON_USE_ASYNC_SLOTS 0
369 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
370 #define CYTHON_USE_ASYNC_SLOTS 1
372 #if PY_VERSION_HEX < 0x02070000
373 #undef CYTHON_USE_PYLONG_INTERNALS
374 #define CYTHON_USE_PYLONG_INTERNALS 0
375 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
376 #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
378 #ifndef CYTHON_USE_PYLIST_INTERNALS
379 #define CYTHON_USE_PYLIST_INTERNALS 1
381 #ifndef CYTHON_USE_UNICODE_INTERNALS
382 #define CYTHON_USE_UNICODE_INTERNALS 1
384 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
385 #undef CYTHON_USE_UNICODE_WRITER
386 #define CYTHON_USE_UNICODE_WRITER 0
387 #elif !defined(CYTHON_USE_UNICODE_WRITER)
388 #define CYTHON_USE_UNICODE_WRITER 1
390 #ifndef CYTHON_AVOID_BORROWED_REFS
391 #define CYTHON_AVOID_BORROWED_REFS 0
393 #ifndef CYTHON_ASSUME_SAFE_MACROS
394 #define CYTHON_ASSUME_SAFE_MACROS 1
396 #ifndef CYTHON_UNPACK_METHODS
397 #define CYTHON_UNPACK_METHODS 1
399 #if PY_VERSION_HEX >= 0x030B00A4
400 #undef CYTHON_FAST_THREAD_STATE
401 #define CYTHON_FAST_THREAD_STATE 0
402 #elif !defined(CYTHON_FAST_THREAD_STATE)
403 #define CYTHON_FAST_THREAD_STATE 1
405 #ifndef CYTHON_FAST_PYCALL
406 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
408 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
409 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
411 #ifndef CYTHON_USE_TP_FINALIZE
412 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
414 #ifndef CYTHON_USE_DICT_VERSIONS
415 #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
417 #if PY_VERSION_HEX >= 0x030B00A4
418 #undef CYTHON_USE_EXC_INFO_STACK
419 #define CYTHON_USE_EXC_INFO_STACK 0
420 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
421 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
423 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
424 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
427 #if !defined(CYTHON_FAST_PYCCALL)
428 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
430 #if CYTHON_USE_PYLONG_INTERNALS
431 #if PY_MAJOR_VERSION < 3
432 #include "longintrepr.h"
438 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
441 #ifndef __has_attribute
442 #define __has_attribute(x) 0
444 #ifndef __has_cpp_attribute
445 #define __has_cpp_attribute(x) 0
447 #ifndef CYTHON_RESTRICT
448 #if defined(__GNUC__)
449 #define CYTHON_RESTRICT __restrict__
450 #elif defined(_MSC_VER) && _MSC_VER >= 1400
451 #define CYTHON_RESTRICT __restrict
452 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
453 #define CYTHON_RESTRICT restrict
455 #define CYTHON_RESTRICT
458 #ifndef CYTHON_UNUSED
459 # if defined(__GNUC__)
460 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
461 # define CYTHON_UNUSED __attribute__ ((__unused__))
463 # define CYTHON_UNUSED
465 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
466 # define CYTHON_UNUSED __attribute__ ((__unused__))
468 # define CYTHON_UNUSED
471 #ifndef CYTHON_MAYBE_UNUSED_VAR
472 # if defined(__cplusplus)
473 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
475 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
478 #ifndef CYTHON_NCP_UNUSED
479 # if CYTHON_COMPILING_IN_CPYTHON
480 # define CYTHON_NCP_UNUSED
482 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
487 #ifndef _MSC_STDINT_H_
489 typedef unsigned char uint8_t;
490 typedef unsigned int uint32_t;
492 typedef unsigned __int8 uint8_t;
493 typedef unsigned __int32 uint32_t;
499 #ifndef CYTHON_FALLTHROUGH
500 #if defined(__cplusplus) && __cplusplus >= 201103L
501 #if __has_cpp_attribute(fallthrough)
502 #define CYTHON_FALLTHROUGH [[fallthrough]]
503 #elif __has_cpp_attribute(clang::fallthrough)
504 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
505 #elif __has_cpp_attribute(gnu::fallthrough)
506 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
509 #ifndef CYTHON_FALLTHROUGH
510 #if __has_attribute(fallthrough)
511 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
513 #define CYTHON_FALLTHROUGH
516 #if defined(__clang__ ) && defined(__apple_build_version__)
517 #if __apple_build_version__ < 7000000
518 #undef CYTHON_FALLTHROUGH
519 #define CYTHON_FALLTHROUGH
525 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
527 #ifndef CYTHON_INLINE
528 #if defined(__clang__)
529 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
531 #define CYTHON_INLINE inline
535 void __Pyx_call_destructor(T& x) {
539 class __Pyx_FakeReference {
541 __Pyx_FakeReference() : ptr(NULL) { }
542 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
543 T *operator->() {
return ptr; }
544 T *operator&() {
return ptr; }
545 operator T&() {
return *ptr; }
546 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
547 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
552 #define __PYX_BUILD_PY_SSIZE_T "n"
553 #define CYTHON_FORMAT_SSIZE_T "z"
554 #if PY_MAJOR_VERSION < 3
555 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
556 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
557 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
558 #define __Pyx_DefaultClassType PyClass_Type
560 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
561 #define __Pyx_DefaultClassType PyType_Type
562 #if PY_VERSION_HEX >= 0x030B00A1
563 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
564 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
565 PyObject *fv, PyObject *cell, PyObject* fn,
566 PyObject *name,
int fline, PyObject *lnos) {
567 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
568 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
569 const char *fn_cstr=NULL;
570 const char *name_cstr=NULL;
571 PyCodeObject* co=NULL;
572 PyObject *type, *value, *traceback;
573 PyErr_Fetch(&type, &value, &traceback);
574 if (!(kwds=PyDict_New()))
goto end;
575 if (!(argcount=PyLong_FromLong(a)))
goto end;
576 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
577 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
578 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
579 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
580 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
581 if (!(nlocals=PyLong_FromLong(l)))
goto end;
582 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
583 if (!(stacksize=PyLong_FromLong(s)))
goto end;
584 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
585 if (!(flags=PyLong_FromLong(f)))
goto end;
586 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
587 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
588 if (PyDict_SetItemString(kwds,
"co_consts", c) != 0)
goto end;
589 if (PyDict_SetItemString(kwds,
"co_names", n) != 0)
goto end;
590 if (PyDict_SetItemString(kwds,
"co_varnames", v) != 0)
goto end;
591 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
592 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
593 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
594 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
595 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
596 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
597 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
598 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
599 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
600 Py_XDECREF((PyObject*)co);
601 co = (PyCodeObject*)call_result;
605 Py_XDECREF((PyObject*)co);
610 Py_XDECREF(argcount);
611 Py_XDECREF(posonlyargcount);
612 Py_XDECREF(kwonlyargcount);
614 Py_XDECREF(stacksize);
616 Py_XDECREF(call_result);
619 PyErr_Restore(type, value, traceback);
624 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
625 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
627 #define __Pyx_DefaultClassType PyType_Type
629 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
630 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
632 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
634 #ifndef Py_TPFLAGS_CHECKTYPES
635 #define Py_TPFLAGS_CHECKTYPES 0
637 #ifndef Py_TPFLAGS_HAVE_INDEX
638 #define Py_TPFLAGS_HAVE_INDEX 0
640 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
641 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
643 #ifndef Py_TPFLAGS_HAVE_FINALIZE
644 #define Py_TPFLAGS_HAVE_FINALIZE 0
646 #ifndef METH_STACKLESS
647 #define METH_STACKLESS 0
649 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
650 #ifndef METH_FASTCALL
651 #define METH_FASTCALL 0x80
653 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
654 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
655 Py_ssize_t nargs, PyObject *kwnames);
657 #define __Pyx_PyCFunctionFast _PyCFunctionFast
658 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
660 #if CYTHON_FAST_PYCCALL
661 #define __Pyx_PyFastCFunction_Check(func)\
662 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
664 #define __Pyx_PyFastCFunction_Check(func) 0
666 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
667 #define PyObject_Malloc(s) PyMem_Malloc(s)
668 #define PyObject_Free(p) PyMem_Free(p)
669 #define PyObject_Realloc(p) PyMem_Realloc(p)
671 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
672 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
673 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
674 #define PyMem_RawFree(p) PyMem_Free(p)
676 #if CYTHON_COMPILING_IN_PYSTON
677 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
678 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
680 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
681 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
683 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
684 #define __Pyx_PyThreadState_Current PyThreadState_GET()
685 #elif PY_VERSION_HEX >= 0x03060000
686 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
687 #elif PY_VERSION_HEX >= 0x03000000
688 #define __Pyx_PyThreadState_Current PyThreadState_GET()
690 #define __Pyx_PyThreadState_Current _PyThreadState_Current
692 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
693 #include "pythread.h"
694 #define Py_tss_NEEDS_INIT 0
695 typedef int Py_tss_t;
696 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
697 *key = PyThread_create_key();
700 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
701 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
702 *key = Py_tss_NEEDS_INIT;
705 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
708 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
709 return *key != Py_tss_NEEDS_INIT;
711 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
712 PyThread_delete_key(*key);
713 *key = Py_tss_NEEDS_INIT;
715 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
716 return PyThread_set_key_value(*key, value);
718 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
719 return PyThread_get_key_value(*key);
722 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
723 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
725 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
727 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
728 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
729 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
731 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
732 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
734 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
735 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
737 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
739 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
740 #define CYTHON_PEP393_ENABLED 1
741 #if PY_VERSION_HEX >= 0x030C0000
742 #define __Pyx_PyUnicode_READY(op) (0)
744 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
745 0 : _PyUnicode_Ready((PyObject *)(op)))
747 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
748 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
749 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
750 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
751 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
752 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
753 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
754 #if PY_VERSION_HEX >= 0x030C0000
755 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
757 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
758 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
760 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
764 #define CYTHON_PEP393_ENABLED 0
765 #define PyUnicode_1BYTE_KIND 1
766 #define PyUnicode_2BYTE_KIND 2
767 #define PyUnicode_4BYTE_KIND 4
768 #define __Pyx_PyUnicode_READY(op) (0)
769 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
770 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
771 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
772 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
773 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
774 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
775 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
776 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
778 #if CYTHON_COMPILING_IN_PYPY
779 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
780 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
782 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
783 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
784 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
786 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
787 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
789 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
790 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
792 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
793 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
795 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
796 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
797 #if PY_MAJOR_VERSION >= 3
798 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
800 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
802 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
803 #define PyObject_ASCII(o) PyObject_Repr(o)
805 #if PY_MAJOR_VERSION >= 3
806 #define PyBaseString_Type PyUnicode_Type
807 #define PyStringObject PyUnicodeObject
808 #define PyString_Type PyUnicode_Type
809 #define PyString_Check PyUnicode_Check
810 #define PyString_CheckExact PyUnicode_CheckExact
811 #ifndef PyObject_Unicode
812 #define PyObject_Unicode PyObject_Str
815 #if PY_MAJOR_VERSION >= 3
816 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
817 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
819 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
820 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
822 #ifndef PySet_CheckExact
823 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
825 #if PY_VERSION_HEX >= 0x030900A4
826 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
827 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
829 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
830 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
832 #if CYTHON_ASSUME_SAFE_MACROS
833 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
835 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
837 #if PY_MAJOR_VERSION >= 3
838 #define PyIntObject PyLongObject
839 #define PyInt_Type PyLong_Type
840 #define PyInt_Check(op) PyLong_Check(op)
841 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
842 #define PyInt_FromString PyLong_FromString
843 #define PyInt_FromUnicode PyLong_FromUnicode
844 #define PyInt_FromLong PyLong_FromLong
845 #define PyInt_FromSize_t PyLong_FromSize_t
846 #define PyInt_FromSsize_t PyLong_FromSsize_t
847 #define PyInt_AsLong PyLong_AsLong
848 #define PyInt_AS_LONG PyLong_AS_LONG
849 #define PyInt_AsSsize_t PyLong_AsSsize_t
850 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
851 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
852 #define PyNumber_Int PyNumber_Long
854 #if PY_MAJOR_VERSION >= 3
855 #define PyBoolObject PyLongObject
857 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
858 #ifndef PyUnicode_InternFromString
859 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
862 #if PY_VERSION_HEX < 0x030200A4
863 typedef long Py_hash_t;
864 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
865 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
867 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
868 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
870 #if PY_MAJOR_VERSION >= 3
871 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
873 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
875 #if CYTHON_USE_ASYNC_SLOTS
876 #if PY_VERSION_HEX >= 0x030500B1
877 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
878 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
880 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
883 #define __Pyx_PyType_AsAsync(obj) NULL
885 #ifndef __Pyx_PyAsyncMethodsStruct
890 } __Pyx_PyAsyncMethodsStruct;
893 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
894 #if !defined(_USE_MATH_DEFINES)
895 #define _USE_MATH_DEFINES
900 #define __PYX_NAN() ((float) NAN)
902 static CYTHON_INLINE
float __PYX_NAN() {
904 memset(&value, 0xFF,
sizeof(value));
908 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
909 #define __Pyx_truncl trunc
911 #define __Pyx_truncl truncl
914 #define __PYX_MARK_ERR_POS(f_index, lineno) \
915 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
916 #define __PYX_ERR(f_index, lineno, Ln_error) \
917 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
919 #ifndef __PYX_EXTERN_C
921 #define __PYX_EXTERN_C extern "C"
923 #define __PYX_EXTERN_C extern
927 #define __PYX_HAVE__imate___c_linear_operator__py_c_linear_operator
928 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_linear_operator
937 #include "pythread.h"
944 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
945 #define CYTHON_WITHOUT_ASSERTIONS
948 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
949 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
951 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
952 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
953 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
954 #define __PYX_DEFAULT_STRING_ENCODING ""
955 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
956 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
957 #define __Pyx_uchar_cast(c) ((unsigned char)c)
958 #define __Pyx_long_cast(x) ((long)x)
959 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
960 (sizeof(type) < sizeof(Py_ssize_t)) ||\
961 (sizeof(type) > sizeof(Py_ssize_t) &&\
962 likely(v < (type)PY_SSIZE_T_MAX ||\
963 v == (type)PY_SSIZE_T_MAX) &&\
964 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
965 v == (type)PY_SSIZE_T_MIN))) ||\
966 (sizeof(type) == sizeof(Py_ssize_t) &&\
967 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
968 v == (type)PY_SSIZE_T_MAX))) )
969 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
970 return (
size_t) i < (size_t) limit;
972 #if defined (__cplusplus) && __cplusplus >= 201103L
974 #define __Pyx_sst_abs(value) std::abs(value)
975 #elif SIZEOF_INT >= SIZEOF_SIZE_T
976 #define __Pyx_sst_abs(value) abs(value)
977 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
978 #define __Pyx_sst_abs(value) labs(value)
979 #elif defined (_MSC_VER)
980 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
981 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
982 #define __Pyx_sst_abs(value) llabs(value)
983 #elif defined (__GNUC__)
984 #define __Pyx_sst_abs(value) __builtin_llabs(value)
986 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
988 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
989 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
990 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
991 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
992 #define __Pyx_PyBytes_FromString PyBytes_FromString
993 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
994 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
995 #if PY_MAJOR_VERSION < 3
996 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
997 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
999 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1000 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1002 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1003 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1004 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1005 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1006 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1007 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1008 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
1009 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
1010 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
1011 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1012 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1013 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1014 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1015 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1016 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1017 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1018 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
1019 const Py_UNICODE *u_end = u;
1021 return (
size_t)(u_end - u - 1);
1023 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1024 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1025 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1026 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1027 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1028 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1029 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1030 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1031 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1032 #define __Pyx_PySequence_Tuple(obj)\
1033 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1034 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1035 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
1036 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1037 #if CYTHON_ASSUME_SAFE_MACROS
1038 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1040 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1042 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1043 #if PY_MAJOR_VERSION >= 3
1044 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1046 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1048 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1049 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1050 static int __Pyx_sys_getdefaultencoding_not_ascii;
1051 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1053 PyObject* default_encoding = NULL;
1054 PyObject* ascii_chars_u = NULL;
1055 PyObject* ascii_chars_b = NULL;
1056 const char* default_encoding_c;
1057 sys = PyImport_ImportModule(
"sys");
1059 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1061 if (!default_encoding)
goto bad;
1062 default_encoding_c = PyBytes_AsString(default_encoding);
1063 if (!default_encoding_c)
goto bad;
1064 if (strcmp(default_encoding_c,
"ascii") == 0) {
1065 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1067 char ascii_chars[128];
1069 for (c = 0; c < 128; c++) {
1072 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1073 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1074 if (!ascii_chars_u)
goto bad;
1075 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1076 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1079 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1080 default_encoding_c);
1083 Py_DECREF(ascii_chars_u);
1084 Py_DECREF(ascii_chars_b);
1086 Py_DECREF(default_encoding);
1089 Py_XDECREF(default_encoding);
1090 Py_XDECREF(ascii_chars_u);
1091 Py_XDECREF(ascii_chars_b);
1095 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1096 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1098 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1099 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1100 static char* __PYX_DEFAULT_STRING_ENCODING;
1101 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1103 PyObject* default_encoding = NULL;
1104 char* default_encoding_c;
1105 sys = PyImport_ImportModule(
"sys");
1107 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1109 if (!default_encoding)
goto bad;
1110 default_encoding_c = PyBytes_AsString(default_encoding);
1111 if (!default_encoding_c)
goto bad;
1112 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1113 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1114 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1115 Py_DECREF(default_encoding);
1118 Py_XDECREF(default_encoding);
1126 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1127 #define likely(x) __builtin_expect(!!(x), 1)
1128 #define unlikely(x) __builtin_expect(!!(x), 0)
1130 #define likely(x) (x)
1131 #define unlikely(x) (x)
1133 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1135 static PyObject *__pyx_m = NULL;
1136 static PyObject *__pyx_d;
1137 static PyObject *__pyx_b;
1138 static PyObject *__pyx_cython_runtime = NULL;
1139 static PyObject *__pyx_empty_tuple;
1140 static PyObject *__pyx_empty_bytes;
1141 static PyObject *__pyx_empty_unicode;
1142 static int __pyx_lineno;
1143 static int __pyx_clineno = 0;
1144 static const char * __pyx_cfilenm= __FILE__;
1145 static const char *__pyx_filename;
1148 static const char *__pyx_f[] = {
1149 "imate/_c_linear_operator/py_c_linear_operator.pyx",
1153 struct __pyx_memoryview_obj;
1155 struct __pyx_memoryview_obj *memview;
1157 Py_ssize_t shape[8];
1158 Py_ssize_t strides[8];
1159 Py_ssize_t suboffsets[8];
1160 } __Pyx_memviewslice;
1161 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1164 #include <pythread.h>
1165 #ifndef CYTHON_ATOMICS
1166 #define CYTHON_ATOMICS 1
1168 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1169 #define __pyx_atomic_int_type int
1170 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1171 (__GNUC_MINOR__ > 1 ||\
1172 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1173 #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1174 #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1175 #ifdef __PYX_DEBUG_ATOMICS
1176 #warning "Using GNU atomics"
1178 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1180 #undef __pyx_atomic_int_type
1181 #define __pyx_atomic_int_type long
1182 #pragma intrinsic (_InterlockedExchangeAdd)
1183 #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1184 #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1185 #ifdef __PYX_DEBUG_ATOMICS
1186 #pragma message ("Using MSVC atomics")
1189 #undef CYTHON_ATOMICS
1190 #define CYTHON_ATOMICS 0
1191 #ifdef __PYX_DEBUG_ATOMICS
1192 #warning "Not using atomics"
1195 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1197 #define __pyx_add_acquisition_count(memview)\
1198 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1199 #define __pyx_sub_acquisition_count(memview)\
1200 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1202 #define __pyx_add_acquisition_count(memview)\
1203 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1204 #define __pyx_sub_acquisition_count(memview)\
1205 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1209 #ifndef __PYX_FORCE_INIT_THREADS
1210 #define __PYX_FORCE_INIT_THREADS 0
1214 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1215 #define __Pyx_PyGILState_Release PyGILState_Release
1216 #define __Pyx_FastGIL_Remember()
1217 #define __Pyx_FastGIL_Forget()
1218 #define __Pyx_FastGilFuncInit()
1221 #define IS_UNSIGNED(type) (((type) -1) > 0)
1222 struct __Pyx_StructField_;
1223 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1226 struct __Pyx_StructField_* fields;
1228 size_t arraysize[8];
1234 typedef struct __Pyx_StructField_ {
1235 __Pyx_TypeInfo* type;
1238 } __Pyx_StructField;
1240 __Pyx_StructField* field;
1241 size_t parent_offset;
1242 } __Pyx_BufFmt_StackElem;
1244 __Pyx_StructField root;
1245 __Pyx_BufFmt_StackElem* head;
1247 size_t new_count, enc_count;
1248 size_t struct_alignment;
1253 char is_valid_array;
1254 } __Pyx_BufFmt_Context;
1264 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1273 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1282 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1291 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1300 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1309 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1312 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1313 struct __pyx_array_obj;
1314 struct __pyx_MemviewEnum_obj;
1315 struct __pyx_memoryview_obj;
1316 struct __pyx_memoryviewslice_obj;
1325 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1334 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1343 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1352 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1361 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1363 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1367 char *data_type_name;
1368 char *long_index_type_name;
1369 __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1370 PyObject *parameters;
1381 struct __pyx_array_obj {
1383 struct __pyx_vtabstruct_array *__pyx_vtab;
1389 Py_ssize_t *_strides;
1390 Py_ssize_t itemsize;
1393 void (*callback_free_data)(
void *);
1395 int dtype_is_object;
1406 struct __pyx_MemviewEnum_obj {
1419 struct __pyx_memoryview_obj {
1421 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1424 PyObject *_array_interface;
1425 PyThread_type_lock lock;
1426 __pyx_atomic_int acquisition_count[2];
1427 __pyx_atomic_int *acquisition_count_aligned_p;
1430 int dtype_is_object;
1431 __Pyx_TypeInfo *typeinfo;
1442 struct __pyx_memoryviewslice_obj {
1443 struct __pyx_memoryview_obj __pyx_base;
1444 __Pyx_memviewslice from_slice;
1445 PyObject *from_object;
1446 PyObject *(*to_object_func)(
char *);
1447 int (*to_dtype_func)(
char *, PyObject *);
1460 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1461 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1462 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1463 cLinearOperator<float> *(*get_linear_operator_float)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1464 cLinearOperator<double> *(*get_linear_operator_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1465 cLinearOperator<long double> *(*get_linear_operator_long_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1466 void (*dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1467 void (*transpose_dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1469 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1480 struct __pyx_vtabstruct_array {
1481 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1483 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1494 struct __pyx_vtabstruct_memoryview {
1495 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1496 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1497 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1498 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1499 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1500 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1501 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1503 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1514 struct __pyx_vtabstruct__memoryviewslice {
1515 struct __pyx_vtabstruct_memoryview __pyx_base;
1517 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1521 #ifndef CYTHON_REFNANNY
1522 #define CYTHON_REFNANNY 0
1526 void (*INCREF)(
void*, PyObject*, int);
1527 void (*DECREF)(
void*, PyObject*, int);
1528 void (*GOTREF)(
void*, PyObject*, int);
1529 void (*GIVEREF)(
void*, PyObject*, int);
1530 void* (*SetupContext)(
const char*, int,
const char*);
1531 void (*FinishContext)(
void**);
1532 } __Pyx_RefNannyAPIStruct;
1533 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1534 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1535 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1537 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1539 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1540 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1541 PyGILState_Release(__pyx_gilstate_save);\
1543 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1546 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1547 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1549 #define __Pyx_RefNannyFinishContext()\
1550 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1551 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1552 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1553 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1554 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1555 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1556 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1557 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1558 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1560 #define __Pyx_RefNannyDeclarations
1561 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1562 #define __Pyx_RefNannyFinishContext()
1563 #define __Pyx_INCREF(r) Py_INCREF(r)
1564 #define __Pyx_DECREF(r) Py_DECREF(r)
1565 #define __Pyx_GOTREF(r)
1566 #define __Pyx_GIVEREF(r)
1567 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1568 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1569 #define __Pyx_XGOTREF(r)
1570 #define __Pyx_XGIVEREF(r)
1572 #define __Pyx_XDECREF_SET(r, v) do {\
1573 PyObject *tmp = (PyObject *) r;\
1574 r = v; __Pyx_XDECREF(tmp);\
1576 #define __Pyx_DECREF_SET(r, v) do {\
1577 PyObject *tmp = (PyObject *) r;\
1578 r = v; __Pyx_DECREF(tmp);\
1580 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1581 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1584 #if CYTHON_USE_TYPE_SLOTS
1585 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1587 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1591 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1594 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1595 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1598 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1601 #if CYTHON_FAST_THREAD_STATE
1602 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1603 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1604 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1606 #define __Pyx_PyThreadState_declare
1607 #define __Pyx_PyThreadState_assign
1608 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1612 #if CYTHON_FAST_THREAD_STATE
1613 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1614 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1615 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1616 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1617 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1618 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1619 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1620 #if CYTHON_COMPILING_IN_CPYTHON
1621 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1623 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1626 #define __Pyx_PyErr_Clear() PyErr_Clear()
1627 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1628 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1629 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1630 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1631 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1632 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1633 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1637 #ifndef CYTHON_PROFILE
1638 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1639 #define CYTHON_PROFILE 0
1641 #define CYTHON_PROFILE 1
1644 #ifndef CYTHON_TRACE_NOGIL
1645 #define CYTHON_TRACE_NOGIL 0
1647 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1648 #define CYTHON_TRACE 1
1651 #ifndef CYTHON_TRACE
1652 #define CYTHON_TRACE 0
1655 #undef CYTHON_PROFILE_REUSE_FRAME
1657 #ifndef CYTHON_PROFILE_REUSE_FRAME
1658 #define CYTHON_PROFILE_REUSE_FRAME 0
1660 #if CYTHON_PROFILE || CYTHON_TRACE
1661 #include "compile.h"
1662 #include "frameobject.h"
1663 #include "traceback.h"
1664 #if PY_VERSION_HEX >= 0x030b00a6
1665 #ifndef Py_BUILD_CORE
1666 #define Py_BUILD_CORE 1
1668 #include "internal/pycore_frame.h"
1670 #if CYTHON_PROFILE_REUSE_FRAME
1671 #define CYTHON_FRAME_MODIFIER static
1672 #define CYTHON_FRAME_DEL(frame)
1674 #define CYTHON_FRAME_MODIFIER
1675 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1677 #define __Pyx_TraceDeclarations\
1678 static PyCodeObject *__pyx_frame_code = NULL;\
1679 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1680 int __Pyx_use_tracing = 0;
1681 #define __Pyx_TraceFrameInit(codeobj)\
1682 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1683 #if PY_VERSION_HEX >= 0x030b00a2
1684 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1685 (unlikely((tstate)->cframe->use_tracing) &&\
1686 (!(check_tracing) || !(tstate)->tracing) &&\
1687 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1688 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1689 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1690 #elif PY_VERSION_HEX >= 0x030a00b1
1691 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1692 (unlikely((tstate)->cframe->use_tracing) &&\
1693 (!(check_tracing) || !(tstate)->tracing) &&\
1694 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1695 #define __Pyx_EnterTracing(tstate)\
1696 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1697 #define __Pyx_LeaveTracing(tstate)\
1700 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1701 || tstate->c_profilefunc != NULL);\
1704 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1705 (unlikely((tstate)->use_tracing) &&\
1706 (!(check_tracing) || !(tstate)->tracing) &&\
1707 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1708 #define __Pyx_EnterTracing(tstate)\
1709 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1710 #define __Pyx_LeaveTracing(tstate)\
1713 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1714 || tstate->c_profilefunc != NULL);\
1718 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1720 if (CYTHON_TRACE_NOGIL) {\
1721 PyThreadState *tstate;\
1722 PyGILState_STATE state = PyGILState_Ensure();\
1723 tstate = __Pyx_PyThreadState_Current;\
1724 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1725 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1727 PyGILState_Release(state);\
1728 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1731 PyThreadState* tstate = PyThreadState_GET();\
1732 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1733 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1734 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1738 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1739 { PyThreadState* tstate = PyThreadState_GET();\
1740 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1741 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1742 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1746 #define __Pyx_TraceException()\
1747 if (likely(!__Pyx_use_tracing)); else {\
1748 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1749 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1750 __Pyx_EnterTracing(tstate);\
1751 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1753 if (CYTHON_TRACE && tstate->c_tracefunc)\
1754 tstate->c_tracefunc(\
1755 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1756 tstate->c_profilefunc(\
1757 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1758 Py_DECREF(exc_info);\
1760 __Pyx_LeaveTracing(tstate);\
1763 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1764 PyObject *type, *value, *traceback;
1765 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1766 __Pyx_EnterTracing(tstate);
1767 if (CYTHON_TRACE && tstate->c_tracefunc)
1768 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1769 if (tstate->c_profilefunc)
1770 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1771 CYTHON_FRAME_DEL(frame);
1772 __Pyx_LeaveTracing(tstate);
1773 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1776 #define __Pyx_TraceReturn(result, nogil)\
1777 if (likely(!__Pyx_use_tracing)); else {\
1779 if (CYTHON_TRACE_NOGIL) {\
1780 PyThreadState *tstate;\
1781 PyGILState_STATE state = PyGILState_Ensure();\
1782 tstate = __Pyx_PyThreadState_Current;\
1783 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1784 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1786 PyGILState_Release(state);\
1789 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1790 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1791 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1796 #define __Pyx_TraceReturn(result, nogil)\
1797 if (likely(!__Pyx_use_tracing)); else {\
1798 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1799 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1800 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1804 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1805 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1807 #define __Pyx_TraceDeclarations
1808 #define __Pyx_TraceFrameInit(codeobj)
1809 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1810 #define __Pyx_TraceException()
1811 #define __Pyx_TraceReturn(result, nogil)
1814 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1816 PyObject *type, *value, *traceback;
1817 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1818 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1819 __Pyx_EnterTracing(tstate);
1820 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1821 __Pyx_LeaveTracing(tstate);
1823 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1827 Py_XDECREF(traceback);
1832 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1833 if (likely(!__Pyx_use_tracing)); else {\
1835 if (CYTHON_TRACE_NOGIL) {\
1837 PyThreadState *tstate;\
1838 PyGILState_STATE state = PyGILState_Ensure();\
1839 tstate = __Pyx_PyThreadState_Current;\
1840 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1841 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1843 PyGILState_Release(state);\
1844 if (unlikely(ret)) goto_error;\
1847 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1848 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1849 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1850 if (unlikely(ret)) goto_error;\
1855 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1856 if (likely(!__Pyx_use_tracing)); else {\
1857 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1858 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1859 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1860 if (unlikely(ret)) goto_error;\
1865 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1869 #if CYTHON_COMPILING_IN_CPYTHON
1870 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1872 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1876 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1879 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1880 int lineno,
const char *filename,
1881 int full_traceback,
int nogil);
1887 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1890 #if CYTHON_FAST_PYCCALL
1891 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1893 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1897 #if CYTHON_FAST_PYCALL
1898 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1899 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1900 #if 1 || PY_VERSION_HEX < 0x030600B1
1901 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1903 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1905 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1906 (sizeof(char [1 - 2*!(cond)]) - 1)
1907 #ifndef Py_MEMBER_SIZE
1908 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1910 #if CYTHON_FAST_PYCALL
1911 static size_t __pyx_pyframe_localsplus_offset = 0;
1912 #include "frameobject.h"
1913 #if PY_VERSION_HEX >= 0x030b00a6
1914 #ifndef Py_BUILD_CORE
1915 #define Py_BUILD_CORE 1
1917 #include "internal/pycore_frame.h"
1919 #define __Pxy_PyFrame_Initialize_Offsets()\
1920 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1921 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1922 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1923 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1928 #if CYTHON_COMPILING_IN_CPYTHON
1929 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1933 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1936 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1937 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1938 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1939 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1940 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1941 (cache_var) = (value);
1942 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1943 static PY_UINT64_T __pyx_dict_version = 0;\
1944 static PyObject *__pyx_dict_cached_value = NULL;\
1945 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1946 (VAR) = __pyx_dict_cached_value;\
1948 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1949 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1952 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1953 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1954 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1956 #define __PYX_GET_DICT_VERSION(dict) (0)
1957 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1958 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1962 #if CYTHON_USE_DICT_VERSIONS
1963 #define __Pyx_GetModuleGlobalName(var, name) do {\
1964 static PY_UINT64_T __pyx_dict_version = 0;\
1965 static PyObject *__pyx_dict_cached_value = NULL;\
1966 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1967 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1968 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1970 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1971 PY_UINT64_T __pyx_dict_version;\
1972 PyObject *__pyx_dict_cached_value;\
1973 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1975 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1977 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1978 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1979 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1983 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1986 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1989 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1990 #define __Pyx_MEMVIEW_DIRECT 1
1991 #define __Pyx_MEMVIEW_PTR 2
1992 #define __Pyx_MEMVIEW_FULL 4
1993 #define __Pyx_MEMVIEW_CONTIG 8
1994 #define __Pyx_MEMVIEW_STRIDED 16
1995 #define __Pyx_MEMVIEW_FOLLOW 32
1996 #define __Pyx_IS_C_CONTIG 1
1997 #define __Pyx_IS_F_CONTIG 2
1998 static int __Pyx_init_memviewslice(
1999 struct __pyx_memoryview_obj *memview,
2001 __Pyx_memviewslice *memviewslice,
2002 int memview_is_new_reference);
2003 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
2004 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2005 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
2006 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2007 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2008 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2009 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2010 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2011 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2012 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2015 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2018 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
2019 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
2020 const char* function_name);
2023 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2024 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2025 __Pyx__ArgTypeTest(obj, type, name, exact))
2026 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2029 #if PY_MAJOR_VERSION >= 3
2030 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2032 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2036 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2037 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2039 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2040 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2042 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2045 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2046 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2047 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2048 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2049 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2050 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2051 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2052 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2053 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2054 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2055 int wraparound,
int boundscheck);
2056 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2057 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2058 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2059 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2060 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2061 int wraparound,
int boundscheck);
2062 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2063 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2064 int is_list,
int wraparound,
int boundscheck);
2067 #if CYTHON_USE_TYPE_SLOTS
2068 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2070 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2074 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
2076 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2078 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
2080 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2082 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
2084 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2088 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2089 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2090 const char* encoding,
const char* errors,
2091 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
2094 #if CYTHON_FAST_THREAD_STATE
2095 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2096 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2098 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2102 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2105 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2108 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2111 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2114 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2117 #if CYTHON_USE_EXC_INFO_STACK
2118 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2122 #if CYTHON_FAST_THREAD_STATE
2123 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2124 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2125 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2126 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2128 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2129 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2133 #if CYTHON_FAST_THREAD_STATE
2134 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2135 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2137 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2141 #if CYTHON_FAST_THREAD_STATE
2142 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2143 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2145 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2149 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2152 #if CYTHON_COMPILING_IN_CPYTHON
2153 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2154 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2155 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2156 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2158 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2159 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2160 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2162 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2164 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2166 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2167 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2168 PyListObject* L = (PyListObject*) list;
2169 Py_ssize_t len = Py_SIZE(list);
2170 if (likely(L->allocated > len)) {
2172 PyList_SET_ITEM(list, len, x);
2173 __Pyx_SET_SIZE(list, len + 1);
2176 return PyList_Append(list, x);
2179 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2183 #if !CYTHON_COMPILING_IN_PYPY
2184 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2186 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2187 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2191 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2192 #if CYTHON_COMPILING_IN_CPYTHON
2193 PyObject* none = _PyList_Extend((PyListObject*)L, v);
2194 if (unlikely(!none))
2199 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2204 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2205 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2206 PyListObject* L = (PyListObject*) list;
2207 Py_ssize_t len = Py_SIZE(list);
2208 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2210 PyList_SET_ITEM(list, len, x);
2211 __Pyx_SET_SIZE(list, len + 1);
2214 return PyList_Append(list, x);
2217 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2221 #define __Pyx_init_assertions_enabled()
2222 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2223 #define __pyx_assertions_enabled() (1)
2224 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2225 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2226 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2227 static int __pyx_assertions_enabled_flag;
2228 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2229 #undef __Pyx_init_assertions_enabled
2230 static void __Pyx_init_assertions_enabled(
void) {
2231 __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2234 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2238 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2241 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2242 int result = PySequence_Contains(seq, item);
2243 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2247 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2250 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2253 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2254 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2256 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2260 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2261 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2263 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2267 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2270 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2273 static int __Pyx_setup_reduce(PyObject* type_obj);
2276 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2279 #define __Pyx_CyFunction_USED 1
2280 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2281 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2282 #define __Pyx_CYFUNCTION_CCLASS 0x04
2283 #define __Pyx_CyFunction_GetClosure(f)\
2284 (((__pyx_CyFunctionObject *) (f))->func_closure)
2285 #define __Pyx_CyFunction_GetClassObj(f)\
2286 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2287 #define __Pyx_CyFunction_Defaults(type, f)\
2288 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2289 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2290 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2292 PyCFunctionObject func;
2293 #if PY_VERSION_HEX < 0x030500A0
2294 PyObject *func_weakreflist;
2296 PyObject *func_dict;
2297 PyObject *func_name;
2298 PyObject *func_qualname;
2300 PyObject *func_globals;
2301 PyObject *func_code;
2302 PyObject *func_closure;
2303 PyObject *func_classobj;
2305 int defaults_pyobjects;
2306 size_t defaults_size;
2308 PyObject *defaults_tuple;
2309 PyObject *defaults_kwdict;
2310 PyObject *(*defaults_getter)(PyObject *);
2311 PyObject *func_annotations;
2312 } __pyx_CyFunctionObject;
2313 static PyTypeObject *__pyx_CyFunctionType = 0;
2314 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2315 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2316 int flags, PyObject* qualname,
2318 PyObject *module, PyObject *globals,
2320 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2323 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2325 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2327 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2329 static int __pyx_CyFunction_init(
void);
2332 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2333 int flags, PyObject* qualname,
2335 PyObject *module, PyObject *globals,
2339 #ifdef CYTHON_CLINE_IN_TRACEBACK
2340 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2342 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2347 PyCodeObject* code_object;
2349 } __Pyx_CodeObjectCacheEntry;
2350 struct __Pyx_CodeObjectCache {
2353 __Pyx_CodeObjectCacheEntry* entries;
2355 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2356 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2357 static PyCodeObject *__pyx_find_code_object(
int code_line);
2358 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2361 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2362 int py_line,
const char *filename);
2364 #if PY_MAJOR_VERSION < 3
2365 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2366 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2368 #define __Pyx_GetBuffer PyObject_GetBuffer
2369 #define __Pyx_ReleaseBuffer PyBuffer_Release
2375 Py_ssize_t shape, strides, suboffsets;
2376 } __Pyx_Buf_DimInfo;
2382 __Pyx_Buffer *rcbuffer;
2384 __Pyx_Buf_DimInfo diminfo[8];
2385 } __Pyx_LocalBuf_ND;
2388 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2391 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2392 __Pyx_memviewslice *slice2,
2393 int ndim,
size_t itemsize);
2396 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2399 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2400 #define __Pyx_HAS_GCC_DIAGNOSTIC
2404 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2407 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2408 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2409 __Pyx_BufFmt_StackElem* stack,
2410 __Pyx_TypeInfo* type);
2413 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2416 static int __Pyx_ValidateAndInit_memviewslice(
2421 __Pyx_TypeInfo *dtype,
2422 __Pyx_BufFmt_StackElem stack[],
2423 __Pyx_memviewslice *memviewslice,
2424 PyObject *original_obj);
2427 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2430 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2433 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *,
int writable_flag);
2436 static __Pyx_memviewslice
2437 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2438 const char *mode,
int ndim,
2439 size_t sizeof_dtype,
int contig_flag,
2440 int dtype_is_object);
2443 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2446 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2449 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2452 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2455 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2458 static int __Pyx_check_binary_version(
void);
2461 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2463 static __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_rows(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2464 static __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_columns(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2465 static cLinearOperator<float> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_float(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2466 static cLinearOperator<double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2467 static cLinearOperator<long double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2468 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch);
2469 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch);
2470 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2471 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2472 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2473 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2474 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2475 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2476 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2477 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2478 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2479 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2490 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2491 static PyTypeObject *__pyx_array_type = 0;
2492 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2493 static PyTypeObject *__pyx_memoryview_type = 0;
2494 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2495 static PyObject *
generic = 0;
2496 static PyObject *strided = 0;
2497 static PyObject *indirect = 0;
2498 static PyObject *contiguous = 0;
2499 static PyObject *indirect_contiguous = 0;
2500 static int __pyx_memoryview_thread_locks_used;
2501 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2502 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2503 static void *__pyx_align_pointer(
void *,
size_t);
2504 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2505 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2506 static PyObject *_unellipsify(PyObject *,
int);
2507 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2508 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2509 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2510 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2511 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2512 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2513 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2514 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2515 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2516 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2517 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2518 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2519 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2520 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2521 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2522 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2523 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2524 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2525 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2526 static int __pyx_memoryview_err(PyObject *,
char *);
2527 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2528 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2529 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2530 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2531 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2532 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2533 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2534 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2535 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2536 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2537 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = {
"long double", NULL,
sizeof(
long double), { 0 }, 0,
'R', 0, 0 };
2538 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_linear_operator"
2539 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_linear_operator;
2540 int __pyx_module_is_main_imate___c_linear_operator__py_c_linear_operator = 0;
2543 static PyObject *__pyx_builtin_TypeError;
2544 static PyObject *__pyx_builtin_ValueError;
2545 static PyObject *__pyx_builtin_RuntimeError;
2546 static PyObject *__pyx_builtin_MemoryError;
2547 static PyObject *__pyx_builtin_enumerate;
2548 static PyObject *__pyx_builtin_range;
2549 static PyObject *__pyx_builtin_Ellipsis;
2550 static PyObject *__pyx_builtin_id;
2551 static PyObject *__pyx_builtin_IndexError;
2552 static const char __pyx_k_O[] =
"O";
2553 static const char __pyx_k_c[] =
"c";
2554 static const char __pyx_k_id[] =
"id";
2555 static const char __pyx_k_dot[] =
"dot";
2556 static const char __pyx_k_new[] =
"__new__";
2557 static const char __pyx_k_obj[] =
"obj";
2558 static const char __pyx_k_base[] =
"base";
2559 static const char __pyx_k_dict[] =
"__dict__";
2560 static const char __pyx_k_main[] =
"__main__";
2561 static const char __pyx_k_mode[] =
"mode";
2562 static const char __pyx_k_name[] =
"name";
2563 static const char __pyx_k_ndim[] =
"ndim";
2564 static const char __pyx_k_pack[] =
"pack";
2565 static const char __pyx_k_self[] =
"self";
2566 static const char __pyx_k_size[] =
"size";
2567 static const char __pyx_k_step[] =
"step";
2568 static const char __pyx_k_stop[] =
"stop";
2569 static const char __pyx_k_test[] =
"__test__";
2570 static const char __pyx_k_ASCII[] =
"ASCII";
2571 static const char __pyx_k_array[] =
"array";
2572 static const char __pyx_k_class[] =
"__class__";
2573 static const char __pyx_k_dtype[] =
"dtype";
2574 static const char __pyx_k_error[] =
"error";
2575 static const char __pyx_k_flags[] =
"flags";
2576 static const char __pyx_k_numpy[] =
"numpy";
2577 static const char __pyx_k_range[] =
"range";
2578 static const char __pyx_k_shape[] =
"shape";
2579 static const char __pyx_k_start[] =
"start";
2580 static const char __pyx_k_astype[] =
"astype";
2581 static const char __pyx_k_encode[] =
"encode";
2582 static const char __pyx_k_format[] =
"format";
2583 static const char __pyx_k_import[] =
"__import__";
2584 static const char __pyx_k_name_2[] =
"__name__";
2585 static const char __pyx_k_pickle[] =
"pickle";
2586 static const char __pyx_k_reduce[] =
"__reduce__";
2587 static const char __pyx_k_struct[] =
"struct";
2588 static const char __pyx_k_unpack[] =
"unpack";
2589 static const char __pyx_k_update[] =
"update";
2590 static const char __pyx_k_vector[] =
"vector";
2591 static const char __pyx_k_float32[] =
"float32";
2592 static const char __pyx_k_float64[] =
"float64";
2593 static const char __pyx_k_fortran[] =
"fortran";
2594 static const char __pyx_k_memview[] =
"memview";
2595 static const char __pyx_k_product[] =
"product";
2596 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2597 static const char __pyx_k_float128[] =
"float128";
2598 static const char __pyx_k_getstate[] =
"__getstate__";
2599 static const char __pyx_k_isscalar[] =
"isscalar";
2600 static const char __pyx_k_itemsize[] =
"itemsize";
2601 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2602 static const char __pyx_k_setstate[] =
"__setstate__";
2603 static const char __pyx_k_TypeError[] =
"TypeError";
2604 static const char __pyx_k_enumerate[] =
"enumerate";
2605 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2606 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2607 static const char __pyx_k_IndexError[] =
"IndexError";
2608 static const char __pyx_k_ValueError[] =
"ValueError";
2609 static const char __pyx_k_parameters[] =
"parameters_";
2610 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2611 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2612 static const char __pyx_k_MemoryError[] =
"MemoryError";
2613 static const char __pyx_k_PickleError[] =
"PickleError";
2614 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2615 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2616 static const char __pyx_k_stringsource[] =
"stringsource";
2617 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2618 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2619 static const char __pyx_k_transpose_dot[] =
"transpose_dot";
2620 static const char __pyx_k_set_parameters[] =
"set_parameters";
2621 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2622 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2623 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2624 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2625 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2626 static const char __pyx_k_pycLinearOperator[] =
"pycLinearOperator";
2627 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2628 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2629 static const char __pyx_k_get_data_type_name[] =
"get_data_type_name";
2630 static const char __pyx_k_get_num_parameters[] =
"get_num_parameters";
2631 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2632 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2633 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2634 static const char __pyx_k_pycLinearOperator_dot[] =
"pycLinearOperator.dot";
2635 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2636 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2637 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2638 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2639 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2640 static const char __pyx_k_LinearOperator_object_is_s[] =
"LinearOperator object is: %s";
2641 static const char __pyx_k_Linear_operator_is_not_set[] =
"Linear operator is not set.";
2642 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2643 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2644 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2645 static const char __pyx_k_LongIndexType_has_an_unconventi[] =
"\"LongIndexType\" has an unconventional byte size.";
2646 static const char __pyx_k_pycLinearOperator_get_data_type[] =
"pycLinearOperator.get_data_type_name";
2647 static const char __pyx_k_pycLinearOperator_transpose_dot[] =
"pycLinearOperator.transpose_dot";
2648 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2649 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2650 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2651 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2652 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2653 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2654 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2655 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2656 static const char __pyx_k_Linear_operator_data_type_is_not[] =
"Linear operator data type is not set.";
2657 static const char __pyx_k_Linear_operator_double_type_is_n[] =
"Linear operator (double type) is not set.";
2658 static const char __pyx_k_Linear_operator_float_type_is_no[] =
"Linear operator (float type) is not set.";
2659 static const char __pyx_k_Linear_operator_long_double_type[] =
"Linear operator (long double type) is not set.";
2660 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2661 static const char __pyx_k_The_input_vector_and_product_sho[] =
"The input vector and product should have ";
2662 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2663 static const char __pyx_k_Vector_type_should_be_either_flo[] =
"Vector type should be either \"float32\", \"float64\", or \"float128\".";
2664 static const char __pyx_k_Wrong_accessors_is_called_The_ty[] =
"Wrong accessors is called. The type of the ";
2665 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2666 static const char __pyx_k_imate__c_linear_operator_py_c_li[] =
"imate/_c_linear_operator/py_c_linear_operator.pyx";
2667 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2668 static const char __pyx_k_pycLinearOperator___reduce_cytho[] =
"pycLinearOperator.__reduce_cython__";
2669 static const char __pyx_k_pycLinearOperator___setstate_cyt[] =
"pycLinearOperator.__setstate_cython__";
2670 static const char __pyx_k_pycLinearOperator_get_num_parame[] =
"pycLinearOperator.get_num_parameters";
2671 static const char __pyx_k_pycLinearOperator_set_parameters[] =
"pycLinearOperator.set_parameters";
2672 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2673 static const char __pyx_k_imate__c_linear_operator_py_c_li_2[] =
"imate._c_linear_operator.py_c_linear_operator";
2674 static PyObject *__pyx_n_s_ASCII;
2675 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2676 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2677 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2678 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2679 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2680 static PyObject *__pyx_n_s_Ellipsis;
2681 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2682 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2683 static PyObject *__pyx_n_s_IndexError;
2684 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2685 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2686 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2687 static PyObject *__pyx_kp_u_LinearOperator_object_is_s;
2688 static PyObject *__pyx_kp_u_Linear_operator_data_type_is_not;
2689 static PyObject *__pyx_kp_u_Linear_operator_double_type_is_n;
2690 static PyObject *__pyx_kp_u_Linear_operator_float_type_is_no;
2691 static PyObject *__pyx_kp_u_Linear_operator_is_not_set;
2692 static PyObject *__pyx_kp_u_Linear_operator_long_double_type;
2693 static PyObject *__pyx_kp_u_LongIndexType_has_an_unconventi;
2694 static PyObject *__pyx_n_s_MemoryError;
2695 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2696 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2697 static PyObject *__pyx_n_b_O;
2698 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2699 static PyObject *__pyx_n_s_PickleError;
2700 static PyObject *__pyx_n_s_RuntimeError;
2701 static PyObject *__pyx_kp_u_The_input_vector_and_product_sho;
2702 static PyObject *__pyx_n_s_TypeError;
2703 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2704 static PyObject *__pyx_n_s_ValueError;
2705 static PyObject *__pyx_kp_u_Vector_type_should_be_either_flo;
2706 static PyObject *__pyx_n_s_View_MemoryView;
2707 static PyObject *__pyx_kp_u_Wrong_accessors_is_called_The_ty;
2708 static PyObject *__pyx_n_s_allocate_buffer;
2709 static PyObject *__pyx_n_s_array;
2710 static PyObject *__pyx_n_s_astype;
2711 static PyObject *__pyx_n_s_base;
2712 static PyObject *__pyx_n_s_c;
2713 static PyObject *__pyx_n_u_c;
2714 static PyObject *__pyx_n_s_class;
2715 static PyObject *__pyx_n_s_cline_in_traceback;
2716 static PyObject *__pyx_kp_s_contiguous_and_direct;
2717 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2718 static PyObject *__pyx_n_s_dict;
2719 static PyObject *__pyx_n_s_dot;
2720 static PyObject *__pyx_n_s_dtype;
2721 static PyObject *__pyx_n_s_dtype_is_object;
2722 static PyObject *__pyx_n_s_encode;
2723 static PyObject *__pyx_n_s_enumerate;
2724 static PyObject *__pyx_n_s_error;
2725 static PyObject *__pyx_n_s_flags;
2726 static PyObject *__pyx_n_b_float128;
2727 static PyObject *__pyx_n_u_float128;
2728 static PyObject *__pyx_n_b_float32;
2729 static PyObject *__pyx_n_u_float32;
2730 static PyObject *__pyx_n_b_float64;
2731 static PyObject *__pyx_n_u_float64;
2732 static PyObject *__pyx_n_s_format;
2733 static PyObject *__pyx_n_s_fortran;
2734 static PyObject *__pyx_n_u_fortran;
2735 static PyObject *__pyx_n_s_get_data_type_name;
2736 static PyObject *__pyx_n_s_get_num_parameters;
2737 static PyObject *__pyx_n_s_getstate;
2738 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2739 static PyObject *__pyx_n_s_id;
2740 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_li;
2741 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_li_2;
2742 static PyObject *__pyx_n_s_import;
2743 static PyObject *__pyx_n_s_isscalar;
2744 static PyObject *__pyx_n_s_itemsize;
2745 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2746 static PyObject *__pyx_n_s_main;
2747 static PyObject *__pyx_n_s_memview;
2748 static PyObject *__pyx_n_s_mode;
2749 static PyObject *__pyx_n_s_name;
2750 static PyObject *__pyx_n_s_name_2;
2751 static PyObject *__pyx_n_s_ndim;
2752 static PyObject *__pyx_n_s_new;
2753 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2754 static PyObject *__pyx_n_s_numpy;
2755 static PyObject *__pyx_n_s_obj;
2756 static PyObject *__pyx_n_s_pack;
2757 static PyObject *__pyx_n_s_parameters;
2758 static PyObject *__pyx_n_s_pickle;
2759 static PyObject *__pyx_n_s_product;
2760 static PyObject *__pyx_n_s_pycLinearOperator;
2761 static PyObject *__pyx_n_s_pycLinearOperator___reduce_cytho;
2762 static PyObject *__pyx_n_s_pycLinearOperator___setstate_cyt;
2763 static PyObject *__pyx_n_s_pycLinearOperator_dot;
2764 static PyObject *__pyx_n_s_pycLinearOperator_get_data_type;
2765 static PyObject *__pyx_n_s_pycLinearOperator_get_num_parame;
2766 static PyObject *__pyx_n_s_pycLinearOperator_set_parameters;
2767 static PyObject *__pyx_n_s_pycLinearOperator_transpose_dot;
2768 static PyObject *__pyx_n_s_pyx_PickleError;
2769 static PyObject *__pyx_n_s_pyx_checksum;
2770 static PyObject *__pyx_n_s_pyx_getbuffer;
2771 static PyObject *__pyx_n_s_pyx_result;
2772 static PyObject *__pyx_n_s_pyx_state;
2773 static PyObject *__pyx_n_s_pyx_type;
2774 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2775 static PyObject *__pyx_n_s_pyx_vtable;
2776 static PyObject *__pyx_n_s_range;
2777 static PyObject *__pyx_n_s_reduce;
2778 static PyObject *__pyx_n_s_reduce_cython;
2779 static PyObject *__pyx_n_s_reduce_ex;
2780 static PyObject *__pyx_n_s_self;
2781 static PyObject *__pyx_n_s_set_parameters;
2782 static PyObject *__pyx_n_s_setstate;
2783 static PyObject *__pyx_n_s_setstate_cython;
2784 static PyObject *__pyx_n_s_shape;
2785 static PyObject *__pyx_n_s_size;
2786 static PyObject *__pyx_n_s_start;
2787 static PyObject *__pyx_n_s_step;
2788 static PyObject *__pyx_n_s_stop;
2789 static PyObject *__pyx_kp_s_strided_and_direct;
2790 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2791 static PyObject *__pyx_kp_s_strided_and_indirect;
2792 static PyObject *__pyx_kp_s_stringsource;
2793 static PyObject *__pyx_n_s_struct;
2794 static PyObject *__pyx_n_s_test;
2795 static PyObject *__pyx_n_s_transpose_dot;
2796 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2797 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2798 static PyObject *__pyx_n_s_unpack;
2799 static PyObject *__pyx_n_s_update;
2800 static PyObject *__pyx_n_s_vector;
2801 static int __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2802 static void __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_2__dealloc__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2803 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2804 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2805 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_parameters_);
2806 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product);
2807 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product);
2808 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2809 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2810 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2811 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2812 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2813 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2814 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2815 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2816 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2817 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2818 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2819 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2820 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2821 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2822 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2823 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2824 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2825 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2826 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2827 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2828 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2829 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2830 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2831 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2832 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2833 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2834 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2835 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2836 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2837 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2838 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2839 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2840 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2841 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2842 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2843 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2844 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2845 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2846 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2847 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2848 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2849 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2850 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2851 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2852 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyTypeObject *t, PyObject *a, PyObject *k);
2853 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2854 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2855 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2856 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2857 static PyObject *__pyx_int_0;
2858 static PyObject *__pyx_int_1;
2859 static PyObject *__pyx_int_112105877;
2860 static PyObject *__pyx_int_136983863;
2861 static PyObject *__pyx_int_184977713;
2862 static PyObject *__pyx_int_neg_1;
2863 static PyObject *__pyx_tuple_;
2864 static PyObject *__pyx_tuple__2;
2865 static PyObject *__pyx_tuple__5;
2866 static PyObject *__pyx_tuple__6;
2867 static PyObject *__pyx_tuple__7;
2868 static PyObject *__pyx_tuple__8;
2869 static PyObject *__pyx_slice__32;
2870 static PyObject *__pyx_tuple__11;
2871 static PyObject *__pyx_tuple__12;
2872 static PyObject *__pyx_tuple__15;
2873 static PyObject *__pyx_tuple__17;
2874 static PyObject *__pyx_tuple__18;
2875 static PyObject *__pyx_tuple__19;
2876 static PyObject *__pyx_tuple__20;
2877 static PyObject *__pyx_tuple__21;
2878 static PyObject *__pyx_tuple__22;
2879 static PyObject *__pyx_tuple__23;
2880 static PyObject *__pyx_tuple__24;
2881 static PyObject *__pyx_tuple__25;
2882 static PyObject *__pyx_tuple__26;
2883 static PyObject *__pyx_tuple__27;
2884 static PyObject *__pyx_tuple__28;
2885 static PyObject *__pyx_tuple__29;
2886 static PyObject *__pyx_tuple__30;
2887 static PyObject *__pyx_tuple__31;
2888 static PyObject *__pyx_tuple__33;
2889 static PyObject *__pyx_tuple__34;
2890 static PyObject *__pyx_tuple__35;
2891 static PyObject *__pyx_tuple__37;
2892 static PyObject *__pyx_tuple__38;
2893 static PyObject *__pyx_tuple__39;
2894 static PyObject *__pyx_tuple__40;
2895 static PyObject *__pyx_tuple__41;
2896 static PyObject *__pyx_tuple__42;
2897 static PyObject *__pyx_tuple__43;
2898 static PyObject *__pyx_tuple__44;
2899 static PyObject *__pyx_tuple__45;
2900 static PyObject *__pyx_tuple__46;
2901 static PyObject *__pyx_tuple__47;
2902 static PyObject *__pyx_tuple__48;
2903 static PyObject *__pyx_tuple__49;
2904 static PyObject *__pyx_tuple__50;
2905 static PyObject *__pyx_codeobj__3;
2906 static PyObject *__pyx_codeobj__4;
2907 static PyObject *__pyx_codeobj__9;
2908 static PyObject *__pyx_codeobj__10;
2909 static PyObject *__pyx_codeobj__13;
2910 static PyObject *__pyx_codeobj__14;
2911 static PyObject *__pyx_codeobj__16;
2912 static PyObject *__pyx_codeobj__36;
2924 static int __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2925 static int __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2927 __Pyx_RefNannyDeclarations
2928 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2929 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2930 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
2931 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__cinit__", 0)))
return -1;
2932 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator___cinit__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
2935 __Pyx_RefNannyFinishContext();
2939 static int __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
2940 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_long_index;
2941 int __pyx_v_unsigned_type;
2943 __Pyx_TraceDeclarations
2944 __Pyx_RefNannyDeclarations
2946 PyObject *__pyx_t_2 = NULL;
2947 int __pyx_lineno = 0;
2948 const char *__pyx_filename = NULL;
2949 int __pyx_clineno = 0;
2950 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2951 __Pyx_TraceCall(
"__cinit__", __pyx_f[0], 34, 0, __PYX_ERR(0, 34, __pyx_L1_error));
2960 __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error))
2961 __pyx_v_self->Aop_float = NULL;
2970 __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error))
2971 __pyx_v_self->Aop_double = NULL;
2980 __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error))
2981 __pyx_v_self->Aop_long_double = NULL;
2990 __Pyx_TraceLine(43,0,__PYX_ERR(0, 43, __pyx_L1_error))
2991 __pyx_v_self->data_type_name = NULL;
3000 __Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error))
3001 __pyx_v_self->long_index_type_name = NULL;
3010 __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error))
3011 __Pyx_INCREF(Py_None);
3012 __Pyx_GIVEREF(Py_None);
3013 __Pyx_GOTREF(__pyx_v_self->parameters);
3014 __Pyx_DECREF(__pyx_v_self->parameters);
3015 __pyx_v_self->parameters = Py_None;
3024 __Pyx_TraceLine(49,0,__PYX_ERR(0, 49, __pyx_L1_error))
3025 __pyx_v_long_index = -1;
3034 __Pyx_TraceLine(50,0,__PYX_ERR(0, 50, __pyx_L1_error))
3035 __pyx_t_1 = ((__pyx_v_long_index < 1) != 0);
3045 __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error))
3046 __pyx_v_unsigned_type = 0;
3065 __Pyx_TraceLine(53,0,__PYX_ERR(0, 53, __pyx_L1_error))
3067 __pyx_v_unsigned_type = 1;
3078 __Pyx_TraceLine(56,0,__PYX_ERR(0, 56, __pyx_L1_error))
3079 __pyx_t_1 = (((
sizeof(__pyx_t_5imate_12_definitions_5types_LongIndexType)) == 4) != 0);
3089 __Pyx_TraceLine(57,0,__PYX_ERR(0, 57, __pyx_L1_error))
3090 __pyx_t_1 = (__pyx_v_unsigned_type != 0);
3100 __Pyx_TraceLine(58,0,__PYX_ERR(0, 58, __pyx_L1_error))
3101 __pyx_v_self->long_index_type_name = ((
char *)
"uint32");
3120 __Pyx_TraceLine(60,0,__PYX_ERR(0, 60, __pyx_L1_error))
3122 __pyx_v_self->long_index_type_name = ((
char *)
"int32");
3143 __Pyx_TraceLine(61,0,__PYX_ERR(0, 61, __pyx_L1_error))
3144 __pyx_t_1 = (((
sizeof(__pyx_t_5imate_12_definitions_5types_LongIndexType)) == 8) != 0);
3145 if (likely(__pyx_t_1)) {
3154 __Pyx_TraceLine(62,0,__PYX_ERR(0, 62, __pyx_L1_error))
3155 __pyx_t_1 = (__pyx_v_unsigned_type != 0);
3165 __Pyx_TraceLine(63,0,__PYX_ERR(0, 63, __pyx_L1_error))
3166 __pyx_v_self->long_index_type_name = ((
char *)
"uint64");
3185 __Pyx_TraceLine(65,0,__PYX_ERR(0, 65, __pyx_L1_error))
3187 __pyx_v_self->long_index_type_name = ((
char *)
"int64");
3208 __Pyx_TraceLine(67,0,__PYX_ERR(0, 67, __pyx_L1_error))
3210 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
3211 __Pyx_GOTREF(__pyx_t_2);
3212 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3213 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3214 __PYX_ERR(0, 67, __pyx_L1_error)
3230 __Pyx_XDECREF(__pyx_t_2);
3231 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3234 __Pyx_TraceReturn(Py_None, 0);
3235 __Pyx_RefNannyFinishContext();
3248 static void __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_3__dealloc__(PyObject *__pyx_v_self);
3249 static void __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_3__dealloc__(PyObject *__pyx_v_self) {
3250 __Pyx_RefNannyDeclarations
3251 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3252 __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_2__dealloc__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
3255 __Pyx_RefNannyFinishContext();
3258 static void __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_2__dealloc__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3259 __Pyx_TraceDeclarations
3260 __Pyx_RefNannyDeclarations
3262 int __pyx_lineno = 0;
3263 const char *__pyx_filename = NULL;
3264 int __pyx_clineno = 0;
3265 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3266 __Pyx_TraceCall(
"__dealloc__", __pyx_f[0], 73, 0, __PYX_ERR(0, 73, __pyx_L1_error));
3275 __Pyx_TraceLine(77,0,__PYX_ERR(0, 77, __pyx_L1_error))
3276 __pyx_t_1 = ((__pyx_v_self->Aop_float != NULL) != 0);
3286 __Pyx_TraceLine(78,0,__PYX_ERR(0, 78, __pyx_L1_error))
3287 delete __pyx_v_self->Aop_float;
3296 __Pyx_TraceLine(79,0,__PYX_ERR(0, 79, __pyx_L1_error))
3297 __pyx_v_self->Aop_float = NULL;
3315 __Pyx_TraceLine(81,0,__PYX_ERR(0, 81, __pyx_L1_error))
3316 __pyx_t_1 = ((__pyx_v_self->Aop_double != NULL) != 0);
3326 __Pyx_TraceLine(82,0,__PYX_ERR(0, 82, __pyx_L1_error))
3327 delete __pyx_v_self->Aop_double;
3336 __Pyx_TraceLine(83,0,__PYX_ERR(0, 83, __pyx_L1_error))
3337 __pyx_v_self->Aop_double = NULL;
3355 __Pyx_TraceLine(85,0,__PYX_ERR(0, 85, __pyx_L1_error))
3356 __pyx_t_1 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3366 __Pyx_TraceLine(86,0,__PYX_ERR(0, 86, __pyx_L1_error))
3367 delete __pyx_v_self->Aop_long_double;
3376 __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error))
3377 __pyx_v_self->Aop_long_double = NULL;
3399 __Pyx_WriteUnraisable(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3401 __Pyx_TraceReturn(Py_None, 0);
3402 __Pyx_RefNannyFinishContext();
3413 static __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_rows(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3414 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_r;
3415 __Pyx_TraceDeclarations
3416 __Pyx_RefNannyDeclarations
3418 PyObject *__pyx_t_2 = NULL;
3420 int __pyx_lineno = 0;
3421 const char *__pyx_filename = NULL;
3422 int __pyx_clineno = 0;
3423 __Pyx_RefNannySetupContext(
"get_num_rows", 0);
3424 __Pyx_TraceCall(
"get_num_rows", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
3433 __Pyx_TraceLine(99,0,__PYX_ERR(0, 99, __pyx_L1_error))
3434 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
3435 __Pyx_GOTREF(__pyx_t_2);
3436 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 99, __pyx_L1_error)
3437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3440 __pyx_t_1 = __pyx_t_3;
3441 goto __pyx_L4_bool_binop_done;
3443 __pyx_t_3 = ((__pyx_v_self->Aop_float != NULL) != 0);
3444 __pyx_t_1 = __pyx_t_3;
3445 __pyx_L4_bool_binop_done:;
3455 __Pyx_TraceLine(100,0,__PYX_ERR(0, 100, __pyx_L1_error))
3456 __pyx_r = __pyx_v_self->Aop_float->get_num_rows();
3475 __Pyx_TraceLine(101,0,__PYX_ERR(0, 101, __pyx_L1_error))
3476 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
3477 __Pyx_GOTREF(__pyx_t_2);
3478 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 101, __pyx_L1_error)
3479 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3482 __pyx_t_1 = __pyx_t_3;
3483 goto __pyx_L6_bool_binop_done;
3485 __pyx_t_3 = ((__pyx_v_self->Aop_double != NULL) != 0);
3486 __pyx_t_1 = __pyx_t_3;
3487 __pyx_L6_bool_binop_done:;
3497 __Pyx_TraceLine(102,0,__PYX_ERR(0, 102, __pyx_L1_error))
3498 __pyx_r = __pyx_v_self->Aop_double->get_num_rows();
3517 __Pyx_TraceLine(103,0,__PYX_ERR(0, 103, __pyx_L1_error))
3518 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
3519 __Pyx_GOTREF(__pyx_t_2);
3520 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 103, __pyx_L1_error)
3521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3524 __pyx_t_1 = __pyx_t_3;
3525 goto __pyx_L8_bool_binop_done;
3535 __Pyx_TraceLine(104,0,__PYX_ERR(0, 104, __pyx_L1_error))
3536 __pyx_t_3 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3537 __pyx_t_1 = __pyx_t_3;
3538 __pyx_L8_bool_binop_done:;
3547 __Pyx_TraceLine(103,0,__PYX_ERR(0, 103, __pyx_L1_error))
3548 if (likely(__pyx_t_1)) {
3557 __Pyx_TraceLine(105,0,__PYX_ERR(0, 105, __pyx_L1_error))
3558 __pyx_r = __pyx_v_self->Aop_long_double->get_num_rows();
3577 __Pyx_TraceLine(107,0,__PYX_ERR(0, 107, __pyx_L1_error))
3579 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
3580 __Pyx_GOTREF(__pyx_t_2);
3581 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3582 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3583 __PYX_ERR(0, 107, __pyx_L1_error)
3596 __Pyx_XDECREF(__pyx_t_2);
3597 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_num_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
3600 __Pyx_TraceReturn(Py_None, 0);
3601 __Pyx_RefNannyFinishContext();
3613 static __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_columns(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3614 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_r;
3615 __Pyx_TraceDeclarations
3616 __Pyx_RefNannyDeclarations
3618 PyObject *__pyx_t_2 = NULL;
3620 int __pyx_lineno = 0;
3621 const char *__pyx_filename = NULL;
3622 int __pyx_clineno = 0;
3623 __Pyx_RefNannySetupContext(
"get_num_columns", 0);
3624 __Pyx_TraceCall(
"get_num_columns", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
3633 __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error))
3634 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
3635 __Pyx_GOTREF(__pyx_t_2);
3636 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
3637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3640 __pyx_t_1 = __pyx_t_3;
3641 goto __pyx_L4_bool_binop_done;
3643 __pyx_t_3 = ((__pyx_v_self->Aop_float != NULL) != 0);
3644 __pyx_t_1 = __pyx_t_3;
3645 __pyx_L4_bool_binop_done:;
3655 __Pyx_TraceLine(120,0,__PYX_ERR(0, 120, __pyx_L1_error))
3656 __pyx_r = __pyx_v_self->Aop_float->get_num_columns();
3675 __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error))
3676 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
3677 __Pyx_GOTREF(__pyx_t_2);
3678 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
3679 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3682 __pyx_t_1 = __pyx_t_3;
3683 goto __pyx_L6_bool_binop_done;
3685 __pyx_t_3 = ((__pyx_v_self->Aop_double != NULL) != 0);
3686 __pyx_t_1 = __pyx_t_3;
3687 __pyx_L6_bool_binop_done:;
3697 __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error))
3698 __pyx_r = __pyx_v_self->Aop_double->get_num_columns();
3717 __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error))
3718 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
3719 __Pyx_GOTREF(__pyx_t_2);
3720 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
3721 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3724 __pyx_t_1 = __pyx_t_3;
3725 goto __pyx_L8_bool_binop_done;
3735 __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error))
3736 __pyx_t_3 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3737 __pyx_t_1 = __pyx_t_3;
3738 __pyx_L8_bool_binop_done:;
3747 __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error))
3748 if (likely(__pyx_t_1)) {
3757 __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
3758 __pyx_r = __pyx_v_self->Aop_long_double->get_num_columns();
3777 __Pyx_TraceLine(127,0,__PYX_ERR(0, 127, __pyx_L1_error))
3779 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
3780 __Pyx_GOTREF(__pyx_t_2);
3781 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3783 __PYX_ERR(0, 127, __pyx_L1_error)
3796 __Pyx_XDECREF(__pyx_t_2);
3797 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_num_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
3800 __Pyx_TraceReturn(Py_None, 0);
3801 __Pyx_RefNannyFinishContext();
3814 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3815 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters[] =
"pycLinearOperator.get_num_parameters(self)\n\n :return: Number of parameters.\n :rtype: IndexType\n ";
3816 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters = {
"get_num_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters};
3817 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3818 PyObject *__pyx_r = 0;
3819 __Pyx_RefNannyDeclarations
3820 __Pyx_RefNannySetupContext(
"get_num_parameters (wrapper)", 0);
3821 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
3824 __Pyx_RefNannyFinishContext();
3828 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3829 PyObject *__pyx_r = NULL;
3830 __Pyx_TraceDeclarations
3831 __Pyx_RefNannyDeclarations
3833 PyObject *__pyx_t_2 = NULL;
3835 int __pyx_lineno = 0;
3836 const char *__pyx_filename = NULL;
3837 int __pyx_clineno = 0;
3838 __Pyx_TraceFrameInit(__pyx_codeobj__3)
3839 __Pyx_RefNannySetupContext(
"get_num_parameters", 0);
3840 __Pyx_TraceCall(
"get_num_parameters", __pyx_f[0], 133, 0, __PYX_ERR(0, 133, __pyx_L1_error));
3849 __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3850 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
3851 __Pyx_GOTREF(__pyx_t_2);
3852 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 139, __pyx_L1_error)
3853 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3856 __pyx_t_1 = __pyx_t_3;
3857 goto __pyx_L4_bool_binop_done;
3859 __pyx_t_3 = ((__pyx_v_self->Aop_float != NULL) != 0);
3860 __pyx_t_1 = __pyx_t_3;
3861 __pyx_L4_bool_binop_done:;
3871 __Pyx_TraceLine(140,0,__PYX_ERR(0, 140, __pyx_L1_error))
3872 __Pyx_XDECREF(__pyx_r);
3873 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Aop_float->get_num_parameters());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
3874 __Pyx_GOTREF(__pyx_t_2);
3875 __pyx_r = __pyx_t_2;
3895 __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error))
3896 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
3897 __Pyx_GOTREF(__pyx_t_2);
3898 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 141, __pyx_L1_error)
3899 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3902 __pyx_t_1 = __pyx_t_3;
3903 goto __pyx_L6_bool_binop_done;
3905 __pyx_t_3 = ((__pyx_v_self->Aop_double != NULL) != 0);
3906 __pyx_t_1 = __pyx_t_3;
3907 __pyx_L6_bool_binop_done:;
3917 __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3918 __Pyx_XDECREF(__pyx_r);
3919 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Aop_double->get_num_parameters());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
3920 __Pyx_GOTREF(__pyx_t_2);
3921 __pyx_r = __pyx_t_2;
3941 __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error))
3942 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
3943 __Pyx_GOTREF(__pyx_t_2);
3944 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
3945 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3948 __pyx_t_1 = __pyx_t_3;
3949 goto __pyx_L8_bool_binop_done;
3959 __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error))
3960 __pyx_t_3 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3961 __pyx_t_1 = __pyx_t_3;
3962 __pyx_L8_bool_binop_done:;
3971 __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error))
3972 if (likely(__pyx_t_1)) {
3981 __Pyx_TraceLine(145,0,__PYX_ERR(0, 145, __pyx_L1_error))
3982 __Pyx_XDECREF(__pyx_r);
3983 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Aop_long_double->get_num_parameters());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
3984 __Pyx_GOTREF(__pyx_t_2);
3985 __pyx_r = __pyx_t_2;
4005 __Pyx_TraceLine(147,0,__PYX_ERR(0, 147, __pyx_L1_error))
4007 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
4008 __Pyx_GOTREF(__pyx_t_2);
4009 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4010 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4011 __PYX_ERR(0, 147, __pyx_L1_error)
4024 __Pyx_XDECREF(__pyx_t_2);
4025 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_num_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
4028 __Pyx_XGIVEREF(__pyx_r);
4029 __Pyx_TraceReturn(__pyx_r, 0);
4030 __Pyx_RefNannyFinishContext();
4043 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4044 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name[] =
"pycLinearOperator.get_data_type_name(self)\n\n ";
4045 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name = {
"get_data_type_name", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name};
4046 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4047 PyObject *__pyx_r = 0;
4048 __Pyx_RefNannyDeclarations
4049 __Pyx_RefNannySetupContext(
"get_data_type_name (wrapper)", 0);
4050 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
4053 __Pyx_RefNannyFinishContext();
4057 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
4058 PyObject *__pyx_r = NULL;
4059 __Pyx_TraceDeclarations
4060 __Pyx_RefNannyDeclarations
4062 PyObject *__pyx_t_2 = NULL;
4063 int __pyx_lineno = 0;
4064 const char *__pyx_filename = NULL;
4065 int __pyx_clineno = 0;
4066 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4067 __Pyx_RefNannySetupContext(
"get_data_type_name", 0);
4068 __Pyx_TraceCall(
"get_data_type_name", __pyx_f[0], 153, 0, __PYX_ERR(0, 153, __pyx_L1_error));
4077 __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
4078 __pyx_t_1 = ((__pyx_v_self->data_type_name == NULL) != 0);
4079 if (unlikely(__pyx_t_1)) {
4088 __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error))
4089 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
4090 __Pyx_GOTREF(__pyx_t_2);
4091 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4092 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4093 __PYX_ERR(0, 158, __pyx_L1_error)
4111 __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
4112 __Pyx_XDECREF(__pyx_r);
4113 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
4114 __Pyx_GOTREF(__pyx_t_2);
4115 __pyx_r = __pyx_t_2;
4129 __Pyx_XDECREF(__pyx_t_2);
4130 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_data_type_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
4133 __Pyx_XGIVEREF(__pyx_r);
4134 __Pyx_TraceReturn(__pyx_r, 0);
4135 __Pyx_RefNannyFinishContext();
4147 static cLinearOperator<float> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_float(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
4149 __Pyx_TraceDeclarations
4150 __Pyx_RefNannyDeclarations
4152 PyObject *__pyx_t_2 = NULL;
4153 PyObject *__pyx_t_3 = NULL;
4154 int __pyx_lineno = 0;
4155 const char *__pyx_filename = NULL;
4156 int __pyx_clineno = 0;
4157 __Pyx_RefNannySetupContext(
"get_linear_operator_float", 0);
4158 __Pyx_TraceCall(
"get_linear_operator_float", __pyx_f[0], 166, 0, __PYX_ERR(0, 166, __pyx_L1_error));
4167 __Pyx_TraceLine(170,0,__PYX_ERR(0, 170, __pyx_L1_error))
4168 __pyx_t_1 = ((__pyx_v_self->Aop_float == NULL) != 0);
4169 if (unlikely(__pyx_t_1)) {
4178 __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error))
4179 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
4180 __Pyx_GOTREF(__pyx_t_2);
4181 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4182 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4183 __PYX_ERR(0, 171, __pyx_L1_error)
4201 __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
4202 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
4203 __Pyx_GOTREF(__pyx_t_2);
4204 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_NE));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
4205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4206 if (unlikely(__pyx_t_1)) {
4215 __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
4216 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
4217 __Pyx_GOTREF(__pyx_t_2);
4218 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_LinearOperator_object_is_s, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
4219 __Pyx_GOTREF(__pyx_t_3);
4220 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4229 __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error))
4230 __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
4231 __Pyx_GOTREF(__pyx_t_2);
4232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4233 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
4234 __Pyx_GOTREF(__pyx_t_3);
4235 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4236 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4237 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4238 __PYX_ERR(0, 174, __pyx_L1_error)
4256 __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
4257 __pyx_r = __pyx_v_self->Aop_float;
4270 __Pyx_XDECREF(__pyx_t_2);
4271 __Pyx_XDECREF(__pyx_t_3);
4272 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_linear_operator_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4275 __Pyx_TraceReturn(Py_None, 0);
4276 __Pyx_RefNannyFinishContext();
4288 static cLinearOperator<double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
4290 __Pyx_TraceDeclarations
4291 __Pyx_RefNannyDeclarations
4293 PyObject *__pyx_t_2 = NULL;
4294 PyObject *__pyx_t_3 = NULL;
4295 int __pyx_lineno = 0;
4296 const char *__pyx_filename = NULL;
4297 int __pyx_clineno = 0;
4298 __Pyx_RefNannySetupContext(
"get_linear_operator_double", 0);
4299 __Pyx_TraceCall(
"get_linear_operator_double", __pyx_f[0], 184, 0, __PYX_ERR(0, 184, __pyx_L1_error));
4308 __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
4309 __pyx_t_1 = ((__pyx_v_self->Aop_double == NULL) != 0);
4310 if (unlikely(__pyx_t_1)) {
4319 __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error))
4320 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
4321 __Pyx_GOTREF(__pyx_t_2);
4322 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4323 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4324 __PYX_ERR(0, 189, __pyx_L1_error)
4342 __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
4343 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
4344 __Pyx_GOTREF(__pyx_t_2);
4345 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_NE));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
4346 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4347 if (unlikely(__pyx_t_1)) {
4356 __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
4357 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
4358 __Pyx_GOTREF(__pyx_t_2);
4359 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_LinearOperator_object_is_s, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
4360 __Pyx_GOTREF(__pyx_t_3);
4361 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4370 __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
4371 __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
4372 __Pyx_GOTREF(__pyx_t_2);
4373 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4374 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
4375 __Pyx_GOTREF(__pyx_t_3);
4376 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4377 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4378 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4379 __PYX_ERR(0, 192, __pyx_L1_error)
4397 __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error))
4398 __pyx_r = __pyx_v_self->Aop_double;
4411 __Pyx_XDECREF(__pyx_t_2);
4412 __Pyx_XDECREF(__pyx_t_3);
4413 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_linear_operator_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4416 __Pyx_TraceReturn(Py_None, 0);
4417 __Pyx_RefNannyFinishContext();
4429 static cLinearOperator<long double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
4431 __Pyx_TraceDeclarations
4432 __Pyx_RefNannyDeclarations
4434 PyObject *__pyx_t_2 = NULL;
4435 PyObject *__pyx_t_3 = NULL;
4436 int __pyx_lineno = 0;
4437 const char *__pyx_filename = NULL;
4438 int __pyx_clineno = 0;
4439 __Pyx_RefNannySetupContext(
"get_linear_operator_long_double", 0);
4440 __Pyx_TraceCall(
"get_linear_operator_long_double", __pyx_f[0], 202, 0, __PYX_ERR(0, 202, __pyx_L1_error));
4449 __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
4450 __pyx_t_1 = ((__pyx_v_self->Aop_long_double == NULL) != 0);
4451 if (unlikely(__pyx_t_1)) {
4460 __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error))
4461 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
4462 __Pyx_GOTREF(__pyx_t_2);
4463 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4464 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4465 __PYX_ERR(0, 208, __pyx_L1_error)
4483 __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
4484 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
4485 __Pyx_GOTREF(__pyx_t_2);
4486 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_NE));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
4487 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4488 if (unlikely(__pyx_t_1)) {
4497 __Pyx_TraceLine(214,0,__PYX_ERR(0, 214, __pyx_L1_error))
4498 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
4499 __Pyx_GOTREF(__pyx_t_2);
4500 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_LinearOperator_object_is_s, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
4501 __Pyx_GOTREF(__pyx_t_3);
4502 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4511 __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
4512 __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
4513 __Pyx_GOTREF(__pyx_t_2);
4514 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4515 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
4516 __Pyx_GOTREF(__pyx_t_3);
4517 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4518 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4519 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4520 __PYX_ERR(0, 212, __pyx_L1_error)
4538 __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
4539 __pyx_r = __pyx_v_self->Aop_long_double;
4552 __Pyx_XDECREF(__pyx_t_2);
4553 __Pyx_XDECREF(__pyx_t_3);
4554 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_linear_operator_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4557 __Pyx_TraceReturn(Py_None, 0);
4558 __Pyx_RefNannyFinishContext();
4571 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters_);
4572 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters[] =
"pycLinearOperator.set_parameters(self, parameters_)\n\n This function is only used for the test unit of this class. For the\n actual computations, the parameters are set though ``cLinearOperator``\n object directly, but not by this function.\n ";
4573 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters = {
"set_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters};
4574 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters_) {
4575 PyObject *__pyx_r = 0;
4576 __Pyx_RefNannyDeclarations
4577 __Pyx_RefNannySetupContext(
"set_parameters (wrapper)", 0);
4578 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), ((PyObject *)__pyx_v_parameters_));
4581 __Pyx_RefNannyFinishContext();
4585 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_parameters_) {
4586 PyObject *__pyx_r = NULL;
4587 __Pyx_TraceDeclarations
4588 __Pyx_RefNannyDeclarations
4589 PyObject *__pyx_t_1 = NULL;
4590 PyObject *__pyx_t_2 = NULL;
4591 PyObject *__pyx_t_3 = NULL;
4593 PyObject *__pyx_t_5 = NULL;
4594 int __pyx_lineno = 0;
4595 const char *__pyx_filename = NULL;
4596 int __pyx_clineno = 0;
4597 __Pyx_TraceFrameInit(__pyx_codeobj__9)
4598 __Pyx_RefNannySetupContext(
"set_parameters", 0);
4599 __Pyx_TraceCall(
"set_parameters", __pyx_f[0], 222, 0, __PYX_ERR(0, 222, __pyx_L1_error));
4608 __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error))
4609 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
4610 __Pyx_GOTREF(__pyx_t_2);
4611 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isscalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
4612 __Pyx_GOTREF(__pyx_t_3);
4613 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4615 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4616 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4617 if (likely(__pyx_t_2)) {
4618 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4619 __Pyx_INCREF(__pyx_t_2);
4620 __Pyx_INCREF(
function);
4621 __Pyx_DECREF_SET(__pyx_t_3,
function);
4624 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_parameters_) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_parameters_);
4625 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4626 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
4627 __Pyx_GOTREF(__pyx_t_1);
4628 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4629 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
4630 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4640 __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4641 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4642 __Pyx_GOTREF(__pyx_t_1);
4643 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
4644 __Pyx_GOTREF(__pyx_t_3);
4645 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4646 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4647 __Pyx_GOTREF(__pyx_t_1);
4648 __Pyx_INCREF(__pyx_v_parameters_);
4649 __Pyx_GIVEREF(__pyx_v_parameters_);
4650 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_parameters_);
4651 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4652 __Pyx_GOTREF(__pyx_t_2);
4653 __Pyx_GIVEREF(__pyx_t_1);
4654 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4656 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4657 __Pyx_GOTREF(__pyx_t_1);
4658 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
4659 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error)
4660 __Pyx_GOTREF(__pyx_t_5);
4661 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4663 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4664 __Pyx_GIVEREF(__pyx_t_5);
4665 __Pyx_GOTREF(__pyx_v_self->parameters);
4666 __Pyx_DECREF(__pyx_v_self->parameters);
4667 __pyx_v_self->parameters = __pyx_t_5;
4687 __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4689 __Pyx_INCREF(__pyx_v_parameters_);
4690 __Pyx_GIVEREF(__pyx_v_parameters_);
4691 __Pyx_GOTREF(__pyx_v_self->parameters);
4692 __Pyx_DECREF(__pyx_v_self->parameters);
4693 __pyx_v_self->parameters = __pyx_v_parameters_;
4706 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4709 __Pyx_XDECREF(__pyx_t_1);
4710 __Pyx_XDECREF(__pyx_t_2);
4711 __Pyx_XDECREF(__pyx_t_3);
4712 __Pyx_XDECREF(__pyx_t_5);
4713 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.set_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
4716 __Pyx_XGIVEREF(__pyx_r);
4717 __Pyx_TraceReturn(__pyx_r, 0);
4718 __Pyx_RefNannyFinishContext();
4730 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4731 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch) {
4732 __Pyx_memviewslice __pyx_v_mv_vector_float = { 0, 0, { 0 }, { 0 }, { 0 } };
4733 __Pyx_memviewslice __pyx_v_mv_vector_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4734 __Pyx_memviewslice __pyx_v_mv_vector_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4735 __Pyx_memviewslice __pyx_v_mv_product_float = { 0, 0, { 0 }, { 0 }, { 0 } };
4736 __Pyx_memviewslice __pyx_v_mv_product_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4737 __Pyx_memviewslice __pyx_v_mv_product_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4738 __Pyx_memviewslice __pyx_v_mv_parameters_float = { 0, 0, { 0 }, { 0 }, { 0 } };
4739 __Pyx_memviewslice __pyx_v_mv_parameters_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4740 __Pyx_memviewslice __pyx_v_mv_parameters_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4741 float *__pyx_v_c_vector_float;
4742 double *__pyx_v_c_vector_double;
4743 long double *__pyx_v_c_vector_long_double;
4744 float *__pyx_v_c_product_float;
4745 double *__pyx_v_c_product_double;
4746 long double *__pyx_v_c_product_long_double;
4747 float *__pyx_v_c_parameters_float;
4748 double *__pyx_v_c_parameters_double;
4749 long double *__pyx_v_c_parameters_long_double;
4750 __Pyx_TraceDeclarations
4751 __Pyx_RefNannyDeclarations
4752 PyObject *__pyx_t_1 = NULL;
4753 PyObject *__pyx_t_2 = NULL;
4754 PyObject *__pyx_t_3 = NULL;
4755 PyObject *__pyx_t_4 = NULL;
4757 PyObject *__pyx_t_6 = NULL;
4759 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4760 Py_ssize_t __pyx_t_9;
4762 __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
4763 __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
4764 int __pyx_lineno = 0;
4765 const char *__pyx_filename = NULL;
4766 int __pyx_clineno = 0;
4767 __Pyx_TraceFrameInit(__pyx_codeobj__10)
4768 __Pyx_RefNannySetupContext(
"dot", 0);
4769 __Pyx_TraceCall(
"dot", __pyx_f[0], 238, 0, __PYX_ERR(0, 238, __pyx_L1_error));
4771 if (unlikely(__pyx_skip_dispatch)) ;
4773 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4774 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4775 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4776 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4777 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4779 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dot);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
4780 __Pyx_GOTREF(__pyx_t_1);
4781 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot)) {
4782 __Pyx_INCREF(__pyx_t_1);
4783 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4785 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4786 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4787 if (likely(__pyx_t_4)) {
4788 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4789 __Pyx_INCREF(__pyx_t_4);
4790 __Pyx_INCREF(
function);
4791 __Pyx_DECREF_SET(__pyx_t_3,
function);
4795 #if CYTHON_FAST_PYCALL
4796 if (PyFunction_Check(__pyx_t_3)) {
4797 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
4798 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
4799 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4800 __Pyx_GOTREF(__pyx_t_2);
4803 #if CYTHON_FAST_PYCCALL
4804 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4805 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
4806 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
4807 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4808 __Pyx_GOTREF(__pyx_t_2);
4812 __pyx_t_6 = PyTuple_New(2+__pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
4813 __Pyx_GOTREF(__pyx_t_6);
4815 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
4817 __Pyx_INCREF(__pyx_v_vector);
4818 __Pyx_GIVEREF(__pyx_v_vector);
4819 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_vector);
4820 __Pyx_INCREF(__pyx_v_product);
4821 __Pyx_GIVEREF(__pyx_v_product);
4822 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_product);
4823 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
4824 __Pyx_GOTREF(__pyx_t_2);
4825 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4827 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4828 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4829 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4832 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4833 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4834 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4835 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4836 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4839 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4840 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4852 __Pyx_TraceLine(242,0,__PYX_ERR(0, 242, __pyx_L1_error))
4853 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
4854 __Pyx_GOTREF(__pyx_t_1);
4855 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_product, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
4856 __Pyx_GOTREF(__pyx_t_2);
4857 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
4858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4859 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4860 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 242, __pyx_L1_error)
4861 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4862 if (unlikely(__pyx_t_7)) {
4871 __Pyx_TraceLine(243,0,__PYX_ERR(0, 243, __pyx_L1_error))
4872 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
4873 __Pyx_GOTREF(__pyx_t_3);
4874 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4875 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4876 __PYX_ERR(0, 243, __pyx_L1_error)
4894 __Pyx_TraceLine(276,0,__PYX_ERR(0, 276, __pyx_L1_error))
4895 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
4896 __Pyx_GOTREF(__pyx_t_3);
4897 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float32, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
4898 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4908 __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
4909 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 279, __pyx_L1_error)
4910 __pyx_v_mv_vector_float = __pyx_t_8;
4911 __pyx_t_8.memview = NULL;
4912 __pyx_t_8.data = NULL;
4921 __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
4923 __pyx_v_c_vector_float = (&(*((
float *) ( (__pyx_v_mv_vector_float.data + __pyx_t_9 * __pyx_v_mv_vector_float.strides[0]) ))));
4932 __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
4933 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 283, __pyx_L1_error)
4934 __pyx_v_mv_product_float = __pyx_t_8;
4935 __pyx_t_8.memview = NULL;
4936 __pyx_t_8.data = NULL;
4945 __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error))
4947 __pyx_v_c_product_float = (&(*((
float *) ( (__pyx_v_mv_product_float.data + __pyx_t_9 * __pyx_v_mv_product_float.strides[0]) ))));
4956 __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4957 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
4958 __pyx_t_10 = (__pyx_t_7 != 0);
4968 __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4969 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4970 __Pyx_GOTREF(__pyx_t_2);
4972 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4973 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
4974 if (likely(__pyx_t_1)) {
4975 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4976 __Pyx_INCREF(__pyx_t_1);
4977 __Pyx_INCREF(
function);
4978 __Pyx_DECREF_SET(__pyx_t_2,
function);
4981 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float32) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float32);
4982 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4983 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
4984 __Pyx_GOTREF(__pyx_t_3);
4985 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4986 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 288, __pyx_L1_error)
4987 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4988 __pyx_v_mv_parameters_float = __pyx_t_8;
4989 __pyx_t_8.memview = NULL;
4990 __pyx_t_8.data = NULL;
4999 __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
5001 __pyx_v_c_parameters_float = (&(*((
float *) ( (__pyx_v_mv_parameters_float.data + __pyx_t_9 * __pyx_v_mv_parameters_float.strides[0]) ))));
5010 __Pyx_TraceLine(290,0,__PYX_ERR(0, 290, __pyx_L1_error))
5011 __pyx_v_self->Aop_float->set_parameters(__pyx_v_c_parameters_float);
5029 __Pyx_TraceLine(293,0,__PYX_ERR(0, 293, __pyx_L1_error))
5030 __pyx_v_self->Aop_float->dot(__pyx_v_c_vector_float, __pyx_v_c_product_float);
5049 __Pyx_TraceLine(295,0,__PYX_ERR(0, 295, __pyx_L1_error))
5050 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
5051 __Pyx_GOTREF(__pyx_t_3);
5052 __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float64, Py_EQ));
if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
5053 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5063 __Pyx_TraceLine(298,0,__PYX_ERR(0, 298, __pyx_L1_error))
5064 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 298, __pyx_L1_error)
5065 __pyx_v_mv_vector_double = __pyx_t_11;
5066 __pyx_t_11.memview = NULL;
5067 __pyx_t_11.data = NULL;
5076 __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
5078 __pyx_v_c_vector_double = (&(*((
double *) ( (__pyx_v_mv_vector_double.data + __pyx_t_9 * __pyx_v_mv_vector_double.strides[0]) ))));
5087 __Pyx_TraceLine(302,0,__PYX_ERR(0, 302, __pyx_L1_error))
5088 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 302, __pyx_L1_error)
5089 __pyx_v_mv_product_double = __pyx_t_11;
5090 __pyx_t_11.memview = NULL;
5091 __pyx_t_11.data = NULL;
5100 __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error))
5102 __pyx_v_c_product_double = (&(*((
double *) ( (__pyx_v_mv_product_double.data + __pyx_t_9 * __pyx_v_mv_product_double.strides[0]) ))));
5111 __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error))
5112 __pyx_t_10 = (__pyx_v_self->parameters != Py_None);
5113 __pyx_t_7 = (__pyx_t_10 != 0);
5123 __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
5124 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
5125 __Pyx_GOTREF(__pyx_t_2);
5127 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5128 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5129 if (likely(__pyx_t_1)) {
5130 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5131 __Pyx_INCREF(__pyx_t_1);
5132 __Pyx_INCREF(
function);
5133 __Pyx_DECREF_SET(__pyx_t_2,
function);
5136 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float64) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float64);
5137 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5138 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
5139 __Pyx_GOTREF(__pyx_t_3);
5140 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5141 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 307, __pyx_L1_error)
5142 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5143 __pyx_v_mv_parameters_double = __pyx_t_11;
5144 __pyx_t_11.memview = NULL;
5145 __pyx_t_11.data = NULL;
5154 __Pyx_TraceLine(308,0,__PYX_ERR(0, 308, __pyx_L1_error))
5156 __pyx_v_c_parameters_double = (&(*((
double *) ( (__pyx_v_mv_parameters_double.data + __pyx_t_9 * __pyx_v_mv_parameters_double.strides[0]) ))));
5165 __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error))
5166 __pyx_v_self->Aop_double->set_parameters(__pyx_v_c_parameters_double);
5184 __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
5185 __pyx_v_self->Aop_double->dot(__pyx_v_c_vector_double, __pyx_v_c_product_double);
5204 __Pyx_TraceLine(314,0,__PYX_ERR(0, 314, __pyx_L1_error))
5205 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
5206 __Pyx_GOTREF(__pyx_t_3);
5207 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float128, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
5208 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5209 if (likely(__pyx_t_7)) {
5218 __Pyx_TraceLine(317,0,__PYX_ERR(0, 317, __pyx_L1_error))
5219 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 317, __pyx_L1_error)
5220 __pyx_v_mv_vector_long_double = __pyx_t_12;
5221 __pyx_t_12.memview = NULL;
5222 __pyx_t_12.data = NULL;
5231 __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
5233 __pyx_v_c_vector_long_double = (&(*((
long double *) ( (__pyx_v_mv_vector_long_double.data + __pyx_t_9 * __pyx_v_mv_vector_long_double.strides[0]) ))));
5242 __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error))
5243 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 321, __pyx_L1_error)
5244 __pyx_v_mv_product_long_double = __pyx_t_12;
5245 __pyx_t_12.memview = NULL;
5246 __pyx_t_12.data = NULL;
5255 __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error))
5257 __pyx_v_c_product_long_double = (&(*((
long double *) ( (__pyx_v_mv_product_long_double.data + __pyx_t_9 * __pyx_v_mv_product_long_double.strides[0]) ))));
5266 __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5267 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
5268 __pyx_t_10 = (__pyx_t_7 != 0);
5278 __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error))
5279 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
5280 __Pyx_GOTREF(__pyx_t_2);
5282 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5283 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5284 if (likely(__pyx_t_1)) {
5285 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5286 __Pyx_INCREF(__pyx_t_1);
5287 __Pyx_INCREF(
function);
5288 __Pyx_DECREF_SET(__pyx_t_2,
function);
5291 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float128) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float128);
5292 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5293 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error)
5294 __Pyx_GOTREF(__pyx_t_3);
5295 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5296 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 326, __pyx_L1_error)
5297 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5298 __pyx_v_mv_parameters_long_double = __pyx_t_12;
5299 __pyx_t_12.memview = NULL;
5300 __pyx_t_12.data = NULL;
5309 __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
5311 __pyx_v_c_parameters_long_double = (&(*((
long double *) ( (__pyx_v_mv_parameters_long_double.data + __pyx_t_9 * __pyx_v_mv_parameters_long_double.strides[0]) ))));
5320 __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
5321 __pyx_v_self->Aop_long_double->set_parameters(__pyx_v_c_parameters_long_double);
5339 __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error))
5340 __pyx_v_self->Aop_long_double->dot(__pyx_v_c_vector_long_double, __pyx_v_c_product_long_double);
5359 __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error))
5361 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error)
5362 __Pyx_GOTREF(__pyx_t_3);
5363 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5364 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5365 __PYX_ERR(0, 335, __pyx_L1_error)
5380 __Pyx_XDECREF(__pyx_t_1);
5381 __Pyx_XDECREF(__pyx_t_2);
5382 __Pyx_XDECREF(__pyx_t_3);
5383 __Pyx_XDECREF(__pyx_t_4);
5384 __Pyx_XDECREF(__pyx_t_6);
5385 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5386 __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
5387 __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
5388 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
5390 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_float, 1);
5391 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_double, 1);
5392 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_long_double, 1);
5393 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_float, 1);
5394 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_double, 1);
5395 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_long_double, 1);
5396 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_float, 1);
5397 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_double, 1);
5398 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_long_double, 1);
5399 __Pyx_TraceReturn(Py_None, 0);
5400 __Pyx_RefNannyFinishContext();
5404 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5405 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot[] =
"pycLinearOperator.dot(self, vector, product) -> void\n\n ";
5406 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot = {
"dot", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot};
5407 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5408 PyObject *__pyx_v_vector = 0;
5409 PyObject *__pyx_v_product = 0;
5410 int __pyx_lineno = 0;
5411 const char *__pyx_filename = NULL;
5412 int __pyx_clineno = 0;
5413 PyObject *__pyx_r = 0;
5414 __Pyx_RefNannyDeclarations
5415 __Pyx_RefNannySetupContext(
"dot (wrapper)", 0);
5417 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vector,&__pyx_n_s_product,0};
5418 PyObject* values[2] = {0,0};
5419 if (unlikely(__pyx_kwds)) {
5421 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5423 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5425 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5428 default:
goto __pyx_L5_argtuple_error;
5430 kw_args = PyDict_Size(__pyx_kwds);
5433 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vector)) != 0)) kw_args--;
5434 else goto __pyx_L5_argtuple_error;
5437 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_product)) != 0)) kw_args--;
5439 __Pyx_RaiseArgtupleInvalid(
"dot", 1, 2, 2, 1); __PYX_ERR(0, 238, __pyx_L3_error)
5442 if (unlikely(kw_args > 0)) {
5443 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"dot") < 0)) __PYX_ERR(0, 238, __pyx_L3_error)
5445 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5446 goto __pyx_L5_argtuple_error;
5448 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5449 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5451 __pyx_v_vector = values[0];
5452 __pyx_v_product = values[1];
5454 goto __pyx_L4_argument_unpacking_done;
5455 __pyx_L5_argtuple_error:;
5456 __Pyx_RaiseArgtupleInvalid(
"dot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 238, __pyx_L3_error)
5458 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
5459 __Pyx_RefNannyFinishContext();
5461 __pyx_L4_argument_unpacking_done:;
5462 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), __pyx_v_vector, __pyx_v_product);
5465 __Pyx_RefNannyFinishContext();
5469 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product) {
5470 PyObject *__pyx_r = NULL;
5471 __Pyx_TraceDeclarations
5472 __Pyx_RefNannyDeclarations
5473 PyObject *__pyx_t_1 = NULL;
5474 int __pyx_lineno = 0;
5475 const char *__pyx_filename = NULL;
5476 int __pyx_clineno = 0;
5477 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5478 __Pyx_RefNannySetupContext(
"dot", 0);
5479 __Pyx_TraceCall(
"dot (wrapper)", __pyx_f[0], 238, 0, __PYX_ERR(0, 238, __pyx_L1_error));
5480 __Pyx_XDECREF(__pyx_r);
5481 __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot(__pyx_v_self, __pyx_v_vector, __pyx_v_product, 1);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error)
5482 __pyx_t_1 = __Pyx_void_to_None(NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
5483 __Pyx_GOTREF(__pyx_t_1);
5484 __pyx_r = __pyx_t_1;
5490 __Pyx_XDECREF(__pyx_t_1);
5491 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
5494 __Pyx_XGIVEREF(__pyx_r);
5495 __Pyx_TraceReturn(__pyx_r, 0);
5496 __Pyx_RefNannyFinishContext();
5508 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5509 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch) {
5510 __Pyx_memviewslice __pyx_v_mv_vector_float = { 0, 0, { 0 }, { 0 }, { 0 } };
5511 __Pyx_memviewslice __pyx_v_mv_vector_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5512 __Pyx_memviewslice __pyx_v_mv_vector_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5513 __Pyx_memviewslice __pyx_v_mv_product_float = { 0, 0, { 0 }, { 0 }, { 0 } };
5514 __Pyx_memviewslice __pyx_v_mv_product_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5515 __Pyx_memviewslice __pyx_v_mv_product_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5516 __Pyx_memviewslice __pyx_v_mv_parameters_float = { 0, 0, { 0 }, { 0 }, { 0 } };
5517 __Pyx_memviewslice __pyx_v_mv_parameters_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5518 __Pyx_memviewslice __pyx_v_mv_parameters_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5519 float *__pyx_v_c_vector_float;
5520 double *__pyx_v_c_vector_double;
5521 long double *__pyx_v_c_vector_long_double;
5522 float *__pyx_v_c_product_float;
5523 double *__pyx_v_c_product_double;
5524 long double *__pyx_v_c_product_long_double;
5525 float *__pyx_v_c_parameters_float;
5526 double *__pyx_v_c_parameters_double;
5527 long double *__pyx_v_c_parameters_long_double;
5528 __Pyx_TraceDeclarations
5529 __Pyx_RefNannyDeclarations
5530 PyObject *__pyx_t_1 = NULL;
5531 PyObject *__pyx_t_2 = NULL;
5532 PyObject *__pyx_t_3 = NULL;
5533 PyObject *__pyx_t_4 = NULL;
5535 PyObject *__pyx_t_6 = NULL;
5537 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5538 Py_ssize_t __pyx_t_9;
5540 __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
5541 __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
5542 int __pyx_lineno = 0;
5543 const char *__pyx_filename = NULL;
5544 int __pyx_clineno = 0;
5545 __Pyx_TraceFrameInit(__pyx_codeobj__13)
5546 __Pyx_RefNannySetupContext(
"transpose_dot", 0);
5547 __Pyx_TraceCall(
"transpose_dot", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error));
5549 if (unlikely(__pyx_skip_dispatch)) ;
5551 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5552 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5553 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5554 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5555 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5557 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_transpose_dot);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
5558 __Pyx_GOTREF(__pyx_t_1);
5559 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot)) {
5560 __Pyx_INCREF(__pyx_t_1);
5561 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
5563 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5564 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5565 if (likely(__pyx_t_4)) {
5566 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5567 __Pyx_INCREF(__pyx_t_4);
5568 __Pyx_INCREF(
function);
5569 __Pyx_DECREF_SET(__pyx_t_3,
function);
5573 #if CYTHON_FAST_PYCALL
5574 if (PyFunction_Check(__pyx_t_3)) {
5575 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
5576 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5577 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5578 __Pyx_GOTREF(__pyx_t_2);
5581 #if CYTHON_FAST_PYCCALL
5582 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5583 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
5584 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5585 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5586 __Pyx_GOTREF(__pyx_t_2);
5590 __pyx_t_6 = PyTuple_New(2+__pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
5591 __Pyx_GOTREF(__pyx_t_6);
5593 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
5595 __Pyx_INCREF(__pyx_v_vector);
5596 __Pyx_GIVEREF(__pyx_v_vector);
5597 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_vector);
5598 __Pyx_INCREF(__pyx_v_product);
5599 __Pyx_GIVEREF(__pyx_v_product);
5600 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_product);
5601 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5602 __Pyx_GOTREF(__pyx_t_2);
5603 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5606 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5607 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5610 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5611 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5612 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5613 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5614 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5617 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5618 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5630 __Pyx_TraceLine(346,0,__PYX_ERR(0, 346, __pyx_L1_error))
5631 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
5632 __Pyx_GOTREF(__pyx_t_1);
5633 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_product, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
5634 __Pyx_GOTREF(__pyx_t_2);
5635 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
5636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5638 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
5639 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5640 if (unlikely(__pyx_t_7)) {
5649 __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
5650 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
5651 __Pyx_GOTREF(__pyx_t_3);
5652 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5653 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5654 __PYX_ERR(0, 347, __pyx_L1_error)
5672 __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
5673 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
5674 __Pyx_GOTREF(__pyx_t_3);
5675 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float32, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 380, __pyx_L1_error)
5676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5686 __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error))
5687 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 383, __pyx_L1_error)
5688 __pyx_v_mv_vector_float = __pyx_t_8;
5689 __pyx_t_8.memview = NULL;
5690 __pyx_t_8.data = NULL;
5699 __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
5701 __pyx_v_c_vector_float = (&(*((
float *) ( (__pyx_v_mv_vector_float.data + __pyx_t_9 * __pyx_v_mv_vector_float.strides[0]) ))));
5710 __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error))
5711 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 387, __pyx_L1_error)
5712 __pyx_v_mv_product_float = __pyx_t_8;
5713 __pyx_t_8.memview = NULL;
5714 __pyx_t_8.data = NULL;
5723 __Pyx_TraceLine(388,0,__PYX_ERR(0, 388, __pyx_L1_error))
5725 __pyx_v_c_product_float = (&(*((
float *) ( (__pyx_v_mv_product_float.data + __pyx_t_9 * __pyx_v_mv_product_float.strides[0]) ))));
5734 __Pyx_TraceLine(391,0,__PYX_ERR(0, 391, __pyx_L1_error))
5735 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
5736 __pyx_t_10 = (__pyx_t_7 != 0);
5746 __Pyx_TraceLine(392,0,__PYX_ERR(0, 392, __pyx_L1_error))
5747 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
5748 __Pyx_GOTREF(__pyx_t_2);
5750 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5751 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5752 if (likely(__pyx_t_1)) {
5753 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5754 __Pyx_INCREF(__pyx_t_1);
5755 __Pyx_INCREF(
function);
5756 __Pyx_DECREF_SET(__pyx_t_2,
function);
5759 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float32) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float32);
5760 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5761 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
5762 __Pyx_GOTREF(__pyx_t_3);
5763 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5764 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 392, __pyx_L1_error)
5765 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5766 __pyx_v_mv_parameters_float = __pyx_t_8;
5767 __pyx_t_8.memview = NULL;
5768 __pyx_t_8.data = NULL;
5777 __Pyx_TraceLine(393,0,__PYX_ERR(0, 393, __pyx_L1_error))
5779 __pyx_v_c_parameters_float = (&(*((
float *) ( (__pyx_v_mv_parameters_float.data + __pyx_t_9 * __pyx_v_mv_parameters_float.strides[0]) ))));
5788 __Pyx_TraceLine(394,0,__PYX_ERR(0, 394, __pyx_L1_error))
5789 __pyx_v_self->Aop_float->set_parameters(__pyx_v_c_parameters_float);
5807 __Pyx_TraceLine(397,0,__PYX_ERR(0, 397, __pyx_L1_error))
5808 __pyx_v_self->Aop_float->transpose_dot(__pyx_v_c_vector_float, __pyx_v_c_product_float);
5827 __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5828 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
5829 __Pyx_GOTREF(__pyx_t_3);
5830 __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float64, Py_EQ));
if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
5831 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5841 __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5842 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 402, __pyx_L1_error)
5843 __pyx_v_mv_vector_double = __pyx_t_11;
5844 __pyx_t_11.memview = NULL;
5845 __pyx_t_11.data = NULL;
5854 __Pyx_TraceLine(403,0,__PYX_ERR(0, 403, __pyx_L1_error))
5856 __pyx_v_c_vector_double = (&(*((
double *) ( (__pyx_v_mv_vector_double.data + __pyx_t_9 * __pyx_v_mv_vector_double.strides[0]) ))));
5865 __Pyx_TraceLine(406,0,__PYX_ERR(0, 406, __pyx_L1_error))
5866 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 406, __pyx_L1_error)
5867 __pyx_v_mv_product_double = __pyx_t_11;
5868 __pyx_t_11.memview = NULL;
5869 __pyx_t_11.data = NULL;
5878 __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5880 __pyx_v_c_product_double = (&(*((
double *) ( (__pyx_v_mv_product_double.data + __pyx_t_9 * __pyx_v_mv_product_double.strides[0]) ))));
5889 __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5890 __pyx_t_10 = (__pyx_v_self->parameters != Py_None);
5891 __pyx_t_7 = (__pyx_t_10 != 0);
5901 __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5902 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
5903 __Pyx_GOTREF(__pyx_t_2);
5905 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5906 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5907 if (likely(__pyx_t_1)) {
5908 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5909 __Pyx_INCREF(__pyx_t_1);
5910 __Pyx_INCREF(
function);
5911 __Pyx_DECREF_SET(__pyx_t_2,
function);
5914 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float64) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float64);
5915 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5916 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
5917 __Pyx_GOTREF(__pyx_t_3);
5918 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5919 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 411, __pyx_L1_error)
5920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5921 __pyx_v_mv_parameters_double = __pyx_t_11;
5922 __pyx_t_11.memview = NULL;
5923 __pyx_t_11.data = NULL;
5932 __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error))
5934 __pyx_v_c_parameters_double = (&(*((
double *) ( (__pyx_v_mv_parameters_double.data + __pyx_t_9 * __pyx_v_mv_parameters_double.strides[0]) ))));
5943 __Pyx_TraceLine(413,0,__PYX_ERR(0, 413, __pyx_L1_error))
5944 __pyx_v_self->Aop_double->set_parameters(__pyx_v_c_parameters_double);
5962 __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error))
5963 __pyx_v_self->Aop_double->transpose_dot(__pyx_v_c_vector_double, __pyx_v_c_product_double);
5982 __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error))
5983 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
5984 __Pyx_GOTREF(__pyx_t_3);
5985 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float128, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
5986 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5987 if (likely(__pyx_t_7)) {
5996 __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error))
5997 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 421, __pyx_L1_error)
5998 __pyx_v_mv_vector_long_double = __pyx_t_12;
5999 __pyx_t_12.memview = NULL;
6000 __pyx_t_12.data = NULL;
6009 __Pyx_TraceLine(422,0,__PYX_ERR(0, 422, __pyx_L1_error))
6011 __pyx_v_c_vector_long_double = (&(*((
long double *) ( (__pyx_v_mv_vector_long_double.data + __pyx_t_9 * __pyx_v_mv_vector_long_double.strides[0]) ))));
6020 __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error))
6021 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 425, __pyx_L1_error)
6022 __pyx_v_mv_product_long_double = __pyx_t_12;
6023 __pyx_t_12.memview = NULL;
6024 __pyx_t_12.data = NULL;
6033 __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error))
6035 __pyx_v_c_product_long_double = (&(*((
long double *) ( (__pyx_v_mv_product_long_double.data + __pyx_t_9 * __pyx_v_mv_product_long_double.strides[0]) ))));
6044 __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error))
6045 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
6046 __pyx_t_10 = (__pyx_t_7 != 0);
6056 __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error))
6057 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
6058 __Pyx_GOTREF(__pyx_t_2);
6060 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6061 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
6062 if (likely(__pyx_t_1)) {
6063 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6064 __Pyx_INCREF(__pyx_t_1);
6065 __Pyx_INCREF(
function);
6066 __Pyx_DECREF_SET(__pyx_t_2,
function);
6069 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float128) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float128);
6070 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6071 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
6072 __Pyx_GOTREF(__pyx_t_3);
6073 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6074 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 430, __pyx_L1_error)
6075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6076 __pyx_v_mv_parameters_long_double = __pyx_t_12;
6077 __pyx_t_12.memview = NULL;
6078 __pyx_t_12.data = NULL;
6087 __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
6089 __pyx_v_c_parameters_long_double = (&(*((
long double *) ( (__pyx_v_mv_parameters_long_double.data + __pyx_t_9 * __pyx_v_mv_parameters_long_double.strides[0]) ))));
6098 __Pyx_TraceLine(432,0,__PYX_ERR(0, 432, __pyx_L1_error))
6099 __pyx_v_self->Aop_long_double->set_parameters(__pyx_v_c_parameters_long_double);
6117 __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error))
6118 __pyx_v_self->Aop_long_double->transpose_dot(__pyx_v_c_vector_long_double, __pyx_v_c_product_long_double);
6136 __Pyx_TraceLine(439,0,__PYX_ERR(0, 439, __pyx_L1_error))
6138 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
6139 __Pyx_GOTREF(__pyx_t_3);
6140 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6142 __PYX_ERR(0, 439, __pyx_L1_error)
6157 __Pyx_XDECREF(__pyx_t_1);
6158 __Pyx_XDECREF(__pyx_t_2);
6159 __Pyx_XDECREF(__pyx_t_3);
6160 __Pyx_XDECREF(__pyx_t_4);
6161 __Pyx_XDECREF(__pyx_t_6);
6162 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6163 __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
6164 __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
6165 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.transpose_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
6167 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_float, 1);
6168 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_double, 1);
6169 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_long_double, 1);
6170 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_float, 1);
6171 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_double, 1);
6172 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_long_double, 1);
6173 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_float, 1);
6174 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_double, 1);
6175 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_long_double, 1);
6176 __Pyx_TraceReturn(Py_None, 0);
6177 __Pyx_RefNannyFinishContext();
6181 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6182 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot[] =
"pycLinearOperator.transpose_dot(self, vector, product) -> void\n\n ";
6183 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot = {
"transpose_dot", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot};
6184 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6185 PyObject *__pyx_v_vector = 0;
6186 PyObject *__pyx_v_product = 0;
6187 int __pyx_lineno = 0;
6188 const char *__pyx_filename = NULL;
6189 int __pyx_clineno = 0;
6190 PyObject *__pyx_r = 0;
6191 __Pyx_RefNannyDeclarations
6192 __Pyx_RefNannySetupContext(
"transpose_dot (wrapper)", 0);
6194 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vector,&__pyx_n_s_product,0};
6195 PyObject* values[2] = {0,0};
6196 if (unlikely(__pyx_kwds)) {
6198 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6200 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6202 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6205 default:
goto __pyx_L5_argtuple_error;
6207 kw_args = PyDict_Size(__pyx_kwds);
6210 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vector)) != 0)) kw_args--;
6211 else goto __pyx_L5_argtuple_error;
6214 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_product)) != 0)) kw_args--;
6216 __Pyx_RaiseArgtupleInvalid(
"transpose_dot", 1, 2, 2, 1); __PYX_ERR(0, 342, __pyx_L3_error)
6219 if (unlikely(kw_args > 0)) {
6220 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"transpose_dot") < 0)) __PYX_ERR(0, 342, __pyx_L3_error)
6222 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6223 goto __pyx_L5_argtuple_error;
6225 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6226 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6228 __pyx_v_vector = values[0];
6229 __pyx_v_product = values[1];
6231 goto __pyx_L4_argument_unpacking_done;
6232 __pyx_L5_argtuple_error:;
6233 __Pyx_RaiseArgtupleInvalid(
"transpose_dot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 342, __pyx_L3_error)
6235 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.transpose_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
6236 __Pyx_RefNannyFinishContext();
6238 __pyx_L4_argument_unpacking_done:;
6239 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), __pyx_v_vector, __pyx_v_product);
6242 __Pyx_RefNannyFinishContext();
6246 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product) {
6247 PyObject *__pyx_r = NULL;
6248 __Pyx_TraceDeclarations
6249 __Pyx_RefNannyDeclarations
6250 PyObject *__pyx_t_1 = NULL;
6251 int __pyx_lineno = 0;
6252 const char *__pyx_filename = NULL;
6253 int __pyx_clineno = 0;
6254 __Pyx_TraceFrameInit(__pyx_codeobj__13)
6255 __Pyx_RefNannySetupContext(
"transpose_dot", 0);
6256 __Pyx_TraceCall(
"transpose_dot (wrapper)", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error));
6257 __Pyx_XDECREF(__pyx_r);
6258 __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot(__pyx_v_self, __pyx_v_vector, __pyx_v_product, 1);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error)
6259 __pyx_t_1 = __Pyx_void_to_None(NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
6260 __Pyx_GOTREF(__pyx_t_1);
6261 __pyx_r = __pyx_t_1;
6267 __Pyx_XDECREF(__pyx_t_1);
6268 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.transpose_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
6271 __Pyx_XGIVEREF(__pyx_r);
6272 __Pyx_TraceReturn(__pyx_r, 0);
6273 __Pyx_RefNannyFinishContext();
6284 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6285 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__[] =
"pycLinearOperator.__reduce_cython__(self)";
6286 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__};
6287 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6288 PyObject *__pyx_r = 0;
6289 __Pyx_RefNannyDeclarations
6290 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6291 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
6294 __Pyx_RefNannyFinishContext();
6298 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
6299 PyObject *__pyx_r = NULL;
6300 __Pyx_TraceDeclarations
6301 __Pyx_RefNannyDeclarations
6302 PyObject *__pyx_t_1 = NULL;
6303 int __pyx_lineno = 0;
6304 const char *__pyx_filename = NULL;
6305 int __pyx_clineno = 0;
6306 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6307 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6308 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6316 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
6317 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6318 __Pyx_GOTREF(__pyx_t_1);
6319 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6321 __PYX_ERR(1, 2, __pyx_L1_error)
6331 __Pyx_XDECREF(__pyx_t_1);
6332 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6334 __Pyx_XGIVEREF(__pyx_r);
6335 __Pyx_TraceReturn(__pyx_r, 0);
6336 __Pyx_RefNannyFinishContext();
6348 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
6349 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__[] =
"pycLinearOperator.__setstate_cython__(self, __pyx_state)";
6350 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__};
6351 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6352 PyObject *__pyx_r = 0;
6353 __Pyx_RefNannyDeclarations
6354 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6355 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6358 __Pyx_RefNannyFinishContext();
6362 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6363 PyObject *__pyx_r = NULL;
6364 __Pyx_TraceDeclarations
6365 __Pyx_RefNannyDeclarations
6366 PyObject *__pyx_t_1 = NULL;
6367 int __pyx_lineno = 0;
6368 const char *__pyx_filename = NULL;
6369 int __pyx_clineno = 0;
6370 __Pyx_TraceFrameInit(__pyx_codeobj__16)
6371 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6372 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6379 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
6380 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6381 __Pyx_GOTREF(__pyx_t_1);
6382 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6383 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6384 __PYX_ERR(1, 4, __pyx_L1_error)
6395 __Pyx_XDECREF(__pyx_t_1);
6396 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6398 __Pyx_XGIVEREF(__pyx_r);
6399 __Pyx_TraceReturn(__pyx_r, 0);
6400 __Pyx_RefNannyFinishContext();
6413 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6414 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6415 PyObject *__pyx_v_shape = 0;
6416 Py_ssize_t __pyx_v_itemsize;
6417 PyObject *__pyx_v_format = 0;
6418 PyObject *__pyx_v_mode = 0;
6419 int __pyx_v_allocate_buffer;
6420 int __pyx_lineno = 0;
6421 const char *__pyx_filename = NULL;
6422 int __pyx_clineno = 0;
6424 __Pyx_RefNannyDeclarations
6425 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6427 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6428 PyObject* values[5] = {0,0,0,0,0};
6429 values[3] = ((PyObject *)__pyx_n_s_c);
6430 if (unlikely(__pyx_kwds)) {
6432 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6434 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6436 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6438 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6440 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6442 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6445 default:
goto __pyx_L5_argtuple_error;
6447 kw_args = PyDict_Size(__pyx_kwds);
6450 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6451 else goto __pyx_L5_argtuple_error;
6454 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6456 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
6460 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6462 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
6467 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6468 if (value) { values[3] = value; kw_args--; }
6473 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6474 if (value) { values[4] = value; kw_args--; }
6477 if (unlikely(kw_args > 0)) {
6478 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
6481 switch (PyTuple_GET_SIZE(__pyx_args)) {
6482 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6484 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6486 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6487 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6488 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6490 default:
goto __pyx_L5_argtuple_error;
6493 __pyx_v_shape = ((PyObject*)values[0]);
6494 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
6495 __pyx_v_format = values[2];
6496 __pyx_v_mode = values[3];
6498 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
6508 __pyx_v_allocate_buffer = ((int)1);
6511 goto __pyx_L4_argument_unpacking_done;
6512 __pyx_L5_argtuple_error:;
6513 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
6515 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6516 __Pyx_RefNannyFinishContext();
6518 __pyx_L4_argument_unpacking_done:;
6519 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
6520 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6521 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 123, __pyx_L1_error)
6523 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6538 __Pyx_RefNannyFinishContext();
6542 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
6544 Py_ssize_t __pyx_v_i;
6545 Py_ssize_t __pyx_v_dim;
6546 PyObject **__pyx_v_p;
6549 __Pyx_TraceDeclarations
6550 __Pyx_RefNannyDeclarations
6551 Py_ssize_t __pyx_t_1;
6553 PyObject *__pyx_t_3 = NULL;
6555 PyObject *__pyx_t_5 = NULL;
6556 PyObject *__pyx_t_6 = NULL;
6559 Py_ssize_t __pyx_t_9;
6560 PyObject *__pyx_t_10 = NULL;
6561 Py_ssize_t __pyx_t_11;
6562 int __pyx_lineno = 0;
6563 const char *__pyx_filename = NULL;
6564 int __pyx_clineno = 0;
6565 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6566 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
6567 __Pyx_INCREF(__pyx_v_format);
6576 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
6577 if (unlikely(__pyx_v_shape == Py_None)) {
6578 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6579 __PYX_ERR(1, 130, __pyx_L1_error)
6581 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
6582 __pyx_v_self->ndim = ((int)__pyx_t_1);
6591 __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
6592 __pyx_v_self->itemsize = __pyx_v_itemsize;
6601 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
6602 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6603 if (unlikely(__pyx_t_2)) {
6612 __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
6613 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
6614 __Pyx_GOTREF(__pyx_t_3);
6615 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6616 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6617 __PYX_ERR(1, 134, __pyx_L1_error)
6635 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
6636 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6637 if (unlikely(__pyx_t_2)) {
6646 __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
6647 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
6648 __Pyx_GOTREF(__pyx_t_3);
6649 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6650 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6651 __PYX_ERR(1, 137, __pyx_L1_error)
6669 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
6670 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6671 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6681 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
6682 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
6683 __Pyx_GOTREF(__pyx_t_5);
6685 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6686 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6687 if (likely(__pyx_t_6)) {
6688 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
6689 __Pyx_INCREF(__pyx_t_6);
6690 __Pyx_INCREF(
function);
6691 __Pyx_DECREF_SET(__pyx_t_5,
function);
6694 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
6695 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6696 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
6697 __Pyx_GOTREF(__pyx_t_3);
6698 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6699 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6718 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
6719 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
6720 __pyx_t_3 = __pyx_v_format;
6721 __Pyx_INCREF(__pyx_t_3);
6722 __Pyx_GIVEREF(__pyx_t_3);
6723 __Pyx_GOTREF(__pyx_v_self->_format);
6724 __Pyx_DECREF(__pyx_v_self->_format);
6725 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6735 __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
6736 if (unlikely(__pyx_v_self->_format == Py_None)) {
6737 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
6738 __PYX_ERR(1, 142, __pyx_L1_error)
6740 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
6741 __pyx_v_self->format = __pyx_t_7;
6750 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
6751 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6760 __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
6761 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6770 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
6771 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6772 if (unlikely(__pyx_t_4)) {
6781 __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
6782 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
6783 __Pyx_GOTREF(__pyx_t_3);
6784 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6785 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6786 __PYX_ERR(1, 149, __pyx_L1_error)
6804 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
6806 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6808 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
6809 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6810 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
6812 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
6813 __Pyx_GOTREF(__pyx_t_5);
6815 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
6816 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6817 __pyx_v_dim = __pyx_t_9;
6818 __pyx_v_idx = __pyx_t_8;
6819 __pyx_t_8 = (__pyx_t_8 + 1);
6828 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
6829 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6830 if (unlikely(__pyx_t_4)) {
6839 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
6840 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
6841 __Pyx_GOTREF(__pyx_t_5);
6842 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
6843 __Pyx_GOTREF(__pyx_t_6);
6844 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
6845 __Pyx_GOTREF(__pyx_t_10);
6846 __Pyx_GIVEREF(__pyx_t_5);
6847 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6848 __Pyx_GIVEREF(__pyx_t_6);
6849 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6852 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
6853 __Pyx_GOTREF(__pyx_t_6);
6854 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6855 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
6856 __Pyx_GOTREF(__pyx_t_10);
6857 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6858 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6859 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6860 __PYX_ERR(1, 154, __pyx_L1_error)
6878 __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
6879 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6888 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
6890 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6899 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
6900 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
6910 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
6911 __pyx_v_order =
'F';
6920 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
6921 __Pyx_INCREF(__pyx_n_u_fortran);
6922 __Pyx_GIVEREF(__pyx_n_u_fortran);
6923 __Pyx_GOTREF(__pyx_v_self->mode);
6924 __Pyx_DECREF(__pyx_v_self->mode);
6925 __pyx_v_self->mode = __pyx_n_u_fortran;
6944 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
6945 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
6946 if (likely(__pyx_t_4)) {
6955 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
6956 __pyx_v_order =
'C';
6965 __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
6966 __Pyx_INCREF(__pyx_n_u_c);
6967 __Pyx_GIVEREF(__pyx_n_u_c);
6968 __Pyx_GOTREF(__pyx_v_self->mode);
6969 __Pyx_DECREF(__pyx_v_self->mode);
6970 __pyx_v_self->mode = __pyx_n_u_c;
6989 __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
6991 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
6992 __Pyx_GOTREF(__pyx_t_3);
6993 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
6994 __Pyx_GOTREF(__pyx_t_10);
6995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6996 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6997 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6998 __PYX_ERR(1, 165, __pyx_L1_error)
7009 __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
7010 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7019 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
7020 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7029 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
7030 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
7031 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
7032 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7033 __pyx_v_self->dtype_is_object = __pyx_t_4;
7042 __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
7043 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7053 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
7054 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
7063 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
7064 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7065 if (unlikely(__pyx_t_4)) {
7074 __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
7075 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
7076 __Pyx_GOTREF(__pyx_t_10);
7077 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7078 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7079 __PYX_ERR(1, 177, __pyx_L1_error)
7097 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7098 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7108 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7109 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7118 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7119 if (unlikely(__pyx_v_itemsize == 0)) {
7120 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
7121 __PYX_ERR(1, 181, __pyx_L1_error)
7123 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7124 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
7125 __PYX_ERR(1, 181, __pyx_L1_error)
7127 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7128 __pyx_t_9 = __pyx_t_1;
7129 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7130 __pyx_v_i = __pyx_t_11;
7139 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7140 (__pyx_v_p[__pyx_v_i]) = Py_None;
7149 __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
7183 __Pyx_XDECREF(__pyx_t_3);
7184 __Pyx_XDECREF(__pyx_t_5);
7185 __Pyx_XDECREF(__pyx_t_6);
7186 __Pyx_XDECREF(__pyx_t_10);
7187 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7190 __Pyx_XDECREF(__pyx_v_format);
7191 __Pyx_TraceReturn(Py_None, 0);
7192 __Pyx_RefNannyFinishContext();
7205 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7206 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7208 __Pyx_RefNannyDeclarations
7209 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
7210 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
7213 __Pyx_RefNannyFinishContext();
7217 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7218 int __pyx_v_bufmode;
7220 __Pyx_TraceDeclarations
7221 __Pyx_RefNannyDeclarations
7224 PyObject *__pyx_t_3 = NULL;
7226 Py_ssize_t __pyx_t_5;
7228 Py_ssize_t *__pyx_t_7;
7229 int __pyx_lineno = 0;
7230 const char *__pyx_filename = NULL;
7231 int __pyx_clineno = 0;
7232 if (__pyx_v_info == NULL) {
7233 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
7236 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
7237 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7238 __Pyx_GIVEREF(__pyx_v_info->obj);
7239 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
7248 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7249 __pyx_v_bufmode = -1;
7258 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7259 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
7260 __pyx_t_2 = (__pyx_t_1 != 0);
7270 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7271 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7290 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7291 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
7292 __pyx_t_1 = (__pyx_t_2 != 0);
7302 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7303 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7322 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
7323 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7324 if (unlikely(__pyx_t_1)) {
7333 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
7334 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
7335 __Pyx_GOTREF(__pyx_t_3);
7336 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7337 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7338 __PYX_ERR(1, 193, __pyx_L1_error)
7356 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
7357 __pyx_t_4 = __pyx_v_self->data;
7358 __pyx_v_info->buf = __pyx_t_4;
7367 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
7368 __pyx_t_5 = __pyx_v_self->len;
7369 __pyx_v_info->len = __pyx_t_5;
7378 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
7379 __pyx_t_6 = __pyx_v_self->ndim;
7380 __pyx_v_info->ndim = __pyx_t_6;
7389 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
7390 __pyx_t_7 = __pyx_v_self->_shape;
7391 __pyx_v_info->shape = __pyx_t_7;
7400 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
7401 __pyx_t_7 = __pyx_v_self->_strides;
7402 __pyx_v_info->strides = __pyx_t_7;
7411 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
7412 __pyx_v_info->suboffsets = NULL;
7421 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
7422 __pyx_t_5 = __pyx_v_self->itemsize;
7423 __pyx_v_info->itemsize = __pyx_t_5;
7432 __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
7433 __pyx_v_info->readonly = 0;
7442 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
7443 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7453 __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
7454 __pyx_t_4 = __pyx_v_self->format;
7455 __pyx_v_info->format = __pyx_t_4;
7474 __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
7476 __pyx_v_info->format = NULL;
7487 __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
7488 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7489 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7490 __Pyx_GOTREF(__pyx_v_info->obj);
7491 __Pyx_DECREF(__pyx_v_info->obj);
7492 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7506 __Pyx_XDECREF(__pyx_t_3);
7507 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7509 if (__pyx_v_info->obj != NULL) {
7510 __Pyx_GOTREF(__pyx_v_info->obj);
7511 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7515 if (__pyx_v_info->obj == Py_None) {
7516 __Pyx_GOTREF(__pyx_v_info->obj);
7517 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7520 __Pyx_TraceReturn(Py_None, 0);
7521 __Pyx_RefNannyFinishContext();
7534 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
7535 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7536 __Pyx_RefNannyDeclarations
7537 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7538 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
7541 __Pyx_RefNannyFinishContext();
7544 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
7545 __Pyx_TraceDeclarations
7546 __Pyx_RefNannyDeclarations
7548 int __pyx_lineno = 0;
7549 const char *__pyx_filename = NULL;
7550 int __pyx_clineno = 0;
7551 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7552 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
7561 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
7562 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7572 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
7573 __pyx_v_self->callback_free_data(__pyx_v_self->data);
7592 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
7593 __pyx_t_1 = (__pyx_v_self->free_data != 0);
7603 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
7604 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7614 __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
7615 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7633 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
7634 free(__pyx_v_self->data);
7653 __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
7654 PyObject_Free(__pyx_v_self->_shape);
7667 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7669 __Pyx_TraceReturn(Py_None, 0);
7670 __Pyx_RefNannyFinishContext();
7682 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
7683 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7684 PyObject *__pyx_r = 0;
7685 __Pyx_RefNannyDeclarations
7686 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
7687 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
7690 __Pyx_RefNannyFinishContext();
7694 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
7695 PyObject *__pyx_r = NULL;
7696 __Pyx_TraceDeclarations
7697 __Pyx_RefNannyDeclarations
7698 PyObject *__pyx_t_1 = NULL;
7699 int __pyx_lineno = 0;
7700 const char *__pyx_filename = NULL;
7701 int __pyx_clineno = 0;
7702 __Pyx_RefNannySetupContext(
"__get__", 0);
7703 __Pyx_TraceCall(
"__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
7712 __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
7713 __Pyx_XDECREF(__pyx_r);
7714 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
7715 __Pyx_GOTREF(__pyx_t_1);
7716 __pyx_r = __pyx_t_1;
7730 __Pyx_XDECREF(__pyx_t_1);
7731 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7734 __Pyx_XGIVEREF(__pyx_r);
7735 __Pyx_TraceReturn(__pyx_r, 0);
7736 __Pyx_RefNannyFinishContext();
7748 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
7750 PyObject *__pyx_r = NULL;
7751 __Pyx_TraceDeclarations
7752 __Pyx_RefNannyDeclarations
7753 PyObject *__pyx_t_1 = NULL;
7754 PyObject *__pyx_t_2 = NULL;
7755 PyObject *__pyx_t_3 = NULL;
7756 int __pyx_lineno = 0;
7757 const char *__pyx_filename = NULL;
7758 int __pyx_clineno = 0;
7759 __Pyx_RefNannySetupContext(
"get_memview", 0);
7760 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
7769 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
7770 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7779 __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
7780 __Pyx_XDECREF(__pyx_r);
7781 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
7782 __Pyx_GOTREF(__pyx_t_1);
7783 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
7784 __Pyx_GOTREF(__pyx_t_2);
7785 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
7786 __Pyx_GOTREF(__pyx_t_3);
7787 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7788 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7789 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7790 __Pyx_GIVEREF(__pyx_t_1);
7791 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7792 __Pyx_GIVEREF(__pyx_t_2);
7793 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7796 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
7797 __Pyx_GOTREF(__pyx_t_2);
7798 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7799 __pyx_r = __pyx_t_2;
7813 __Pyx_XDECREF(__pyx_t_1);
7814 __Pyx_XDECREF(__pyx_t_2);
7815 __Pyx_XDECREF(__pyx_t_3);
7816 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7819 __Pyx_XGIVEREF(__pyx_r);
7820 __Pyx_TraceReturn(__pyx_r, 0);
7821 __Pyx_RefNannyFinishContext();
7834 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
7835 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7837 __Pyx_RefNannyDeclarations
7838 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
7839 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
7842 __Pyx_RefNannyFinishContext();
7846 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
7848 __Pyx_TraceDeclarations
7849 __Pyx_RefNannyDeclarations
7850 int __pyx_lineno = 0;
7851 const char *__pyx_filename = NULL;
7852 int __pyx_clineno = 0;
7853 __Pyx_RefNannySetupContext(
"__len__", 0);
7854 __Pyx_TraceCall(
"__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
7863 __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
7864 __pyx_r = (__pyx_v_self->_shape[0]);
7877 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7880 __Pyx_TraceReturn(Py_None, 0);
7881 __Pyx_RefNannyFinishContext();
7894 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
7895 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7896 PyObject *__pyx_r = 0;
7897 __Pyx_RefNannyDeclarations
7898 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
7899 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7902 __Pyx_RefNannyFinishContext();
7906 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7907 PyObject *__pyx_r = NULL;
7908 __Pyx_TraceDeclarations
7909 __Pyx_RefNannyDeclarations
7910 PyObject *__pyx_t_1 = NULL;
7911 PyObject *__pyx_t_2 = NULL;
7912 int __pyx_lineno = 0;
7913 const char *__pyx_filename = NULL;
7914 int __pyx_clineno = 0;
7915 __Pyx_RefNannySetupContext(
"__getattr__", 0);
7916 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
7925 __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
7926 __Pyx_XDECREF(__pyx_r);
7927 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
7928 __Pyx_GOTREF(__pyx_t_1);
7929 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
7930 __Pyx_GOTREF(__pyx_t_2);
7931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7932 __pyx_r = __pyx_t_2;
7946 __Pyx_XDECREF(__pyx_t_1);
7947 __Pyx_XDECREF(__pyx_t_2);
7948 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7951 __Pyx_XGIVEREF(__pyx_r);
7952 __Pyx_TraceReturn(__pyx_r, 0);
7953 __Pyx_RefNannyFinishContext();
7966 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
7967 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7968 PyObject *__pyx_r = 0;
7969 __Pyx_RefNannyDeclarations
7970 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7971 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7974 __Pyx_RefNannyFinishContext();
7978 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7979 PyObject *__pyx_r = NULL;
7980 __Pyx_TraceDeclarations
7981 __Pyx_RefNannyDeclarations
7982 PyObject *__pyx_t_1 = NULL;
7983 PyObject *__pyx_t_2 = NULL;
7984 int __pyx_lineno = 0;
7985 const char *__pyx_filename = NULL;
7986 int __pyx_clineno = 0;
7987 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7988 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
7997 __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
7998 __Pyx_XDECREF(__pyx_r);
7999 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
8000 __Pyx_GOTREF(__pyx_t_1);
8001 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
8002 __Pyx_GOTREF(__pyx_t_2);
8003 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8004 __pyx_r = __pyx_t_2;
8018 __Pyx_XDECREF(__pyx_t_1);
8019 __Pyx_XDECREF(__pyx_t_2);
8020 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8023 __Pyx_XGIVEREF(__pyx_r);
8024 __Pyx_TraceReturn(__pyx_r, 0);
8025 __Pyx_RefNannyFinishContext();
8038 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
8039 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8041 __Pyx_RefNannyDeclarations
8042 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8043 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8046 __Pyx_RefNannyFinishContext();
8050 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8052 __Pyx_TraceDeclarations
8053 __Pyx_RefNannyDeclarations
8054 PyObject *__pyx_t_1 = NULL;
8055 int __pyx_lineno = 0;
8056 const char *__pyx_filename = NULL;
8057 int __pyx_clineno = 0;
8058 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8059 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
8068 __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
8069 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
8070 __Pyx_GOTREF(__pyx_t_1);
8071 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
8072 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8086 __Pyx_XDECREF(__pyx_t_1);
8087 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8090 __Pyx_TraceReturn(Py_None, 0);
8091 __Pyx_RefNannyFinishContext();
8102 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8103 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8104 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8105 PyObject *__pyx_r = 0;
8106 __Pyx_RefNannyDeclarations
8107 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8108 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
8111 __Pyx_RefNannyFinishContext();
8115 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
8116 PyObject *__pyx_r = NULL;
8117 __Pyx_TraceDeclarations
8118 __Pyx_RefNannyDeclarations
8119 PyObject *__pyx_t_1 = NULL;
8120 int __pyx_lineno = 0;
8121 const char *__pyx_filename = NULL;
8122 int __pyx_clineno = 0;
8123 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8124 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8132 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8133 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8134 __Pyx_GOTREF(__pyx_t_1);
8135 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8136 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8137 __PYX_ERR(1, 2, __pyx_L1_error)
8147 __Pyx_XDECREF(__pyx_t_1);
8148 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8150 __Pyx_XGIVEREF(__pyx_r);
8151 __Pyx_TraceReturn(__pyx_r, 0);
8152 __Pyx_RefNannyFinishContext();
8164 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8165 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8166 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8167 PyObject *__pyx_r = 0;
8168 __Pyx_RefNannyDeclarations
8169 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8170 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8173 __Pyx_RefNannyFinishContext();
8177 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8178 PyObject *__pyx_r = NULL;
8179 __Pyx_TraceDeclarations
8180 __Pyx_RefNannyDeclarations
8181 PyObject *__pyx_t_1 = NULL;
8182 int __pyx_lineno = 0;
8183 const char *__pyx_filename = NULL;
8184 int __pyx_clineno = 0;
8185 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8186 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8193 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8194 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8195 __Pyx_GOTREF(__pyx_t_1);
8196 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8197 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8198 __PYX_ERR(1, 4, __pyx_L1_error)
8209 __Pyx_XDECREF(__pyx_t_1);
8210 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8212 __Pyx_XGIVEREF(__pyx_r);
8213 __Pyx_TraceReturn(__pyx_r, 0);
8214 __Pyx_RefNannyFinishContext();
8226 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
8227 struct __pyx_array_obj *__pyx_v_result = 0;
8228 struct __pyx_array_obj *__pyx_r = NULL;
8229 __Pyx_TraceDeclarations
8230 __Pyx_RefNannyDeclarations
8232 PyObject *__pyx_t_2 = NULL;
8233 PyObject *__pyx_t_3 = NULL;
8234 PyObject *__pyx_t_4 = NULL;
8235 PyObject *__pyx_t_5 = NULL;
8236 int __pyx_lineno = 0;
8237 const char *__pyx_filename = NULL;
8238 int __pyx_clineno = 0;
8239 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
8240 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
8249 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8250 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8260 __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
8261 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
8262 __Pyx_GOTREF(__pyx_t_2);
8263 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
8264 __Pyx_GOTREF(__pyx_t_3);
8265 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8266 __Pyx_GOTREF(__pyx_t_4);
8267 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
8268 __Pyx_GOTREF(__pyx_t_5);
8269 __Pyx_INCREF(__pyx_v_shape);
8270 __Pyx_GIVEREF(__pyx_v_shape);
8271 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8272 __Pyx_GIVEREF(__pyx_t_2);
8273 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8274 __Pyx_GIVEREF(__pyx_t_3);
8275 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8276 __Pyx_GIVEREF(__pyx_t_4);
8277 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8281 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8282 __Pyx_GOTREF(__pyx_t_4);
8283 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8284 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
8304 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8306 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
8307 __Pyx_GOTREF(__pyx_t_4);
8308 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8309 __Pyx_GOTREF(__pyx_t_5);
8310 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8311 __Pyx_GOTREF(__pyx_t_3);
8312 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
8313 __Pyx_GOTREF(__pyx_t_2);
8314 __Pyx_INCREF(__pyx_v_shape);
8315 __Pyx_GIVEREF(__pyx_v_shape);
8316 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8317 __Pyx_GIVEREF(__pyx_t_4);
8318 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8319 __Pyx_GIVEREF(__pyx_t_5);
8320 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8321 __Pyx_GIVEREF(__pyx_t_3);
8322 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8334 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
8335 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
8336 __Pyx_GOTREF(__pyx_t_3);
8337 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
8346 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8347 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8348 __Pyx_GOTREF(__pyx_t_5);
8349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8350 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8351 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
8361 __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
8362 __pyx_v_result->data = __pyx_v_buf;
8373 __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
8374 __Pyx_XDECREF(((PyObject *)__pyx_r));
8375 __Pyx_INCREF(((PyObject *)__pyx_v_result));
8376 __pyx_r = __pyx_v_result;
8389 __Pyx_XDECREF(__pyx_t_2);
8390 __Pyx_XDECREF(__pyx_t_3);
8391 __Pyx_XDECREF(__pyx_t_4);
8392 __Pyx_XDECREF(__pyx_t_5);
8393 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8396 __Pyx_XDECREF((PyObject *)__pyx_v_result);
8397 __Pyx_XGIVEREF((PyObject *)__pyx_r);
8398 __Pyx_TraceReturn(__pyx_r, 0);
8399 __Pyx_RefNannyFinishContext();
8412 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8413 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8414 PyObject *__pyx_v_name = 0;
8415 int __pyx_lineno = 0;
8416 const char *__pyx_filename = NULL;
8417 int __pyx_clineno = 0;
8419 __Pyx_RefNannyDeclarations
8420 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
8422 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8423 PyObject* values[1] = {0};
8424 if (unlikely(__pyx_kwds)) {
8426 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8428 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8431 default:
goto __pyx_L5_argtuple_error;
8433 kw_args = PyDict_Size(__pyx_kwds);
8436 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8437 else goto __pyx_L5_argtuple_error;
8439 if (unlikely(kw_args > 0)) {
8440 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
8442 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8443 goto __pyx_L5_argtuple_error;
8445 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8447 __pyx_v_name = values[0];
8449 goto __pyx_L4_argument_unpacking_done;
8450 __pyx_L5_argtuple_error:;
8451 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
8453 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8454 __Pyx_RefNannyFinishContext();
8456 __pyx_L4_argument_unpacking_done:;
8457 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8460 __Pyx_RefNannyFinishContext();
8464 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8466 __Pyx_TraceDeclarations
8467 __Pyx_RefNannyDeclarations
8468 int __pyx_lineno = 0;
8469 const char *__pyx_filename = NULL;
8470 int __pyx_clineno = 0;
8471 __Pyx_RefNannySetupContext(
"__init__", 0);
8472 __Pyx_TraceCall(
"__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
8481 __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
8482 __Pyx_INCREF(__pyx_v_name);
8483 __Pyx_GIVEREF(__pyx_v_name);
8484 __Pyx_GOTREF(__pyx_v_self->name);
8485 __Pyx_DECREF(__pyx_v_self->name);
8486 __pyx_v_self->name = __pyx_v_name;
8500 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8503 __Pyx_TraceReturn(Py_None, 0);
8504 __Pyx_RefNannyFinishContext();
8517 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
8518 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8519 PyObject *__pyx_r = 0;
8520 __Pyx_RefNannyDeclarations
8521 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
8522 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8525 __Pyx_RefNannyFinishContext();
8529 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8530 PyObject *__pyx_r = NULL;
8531 __Pyx_TraceDeclarations
8532 __Pyx_RefNannyDeclarations
8533 int __pyx_lineno = 0;
8534 const char *__pyx_filename = NULL;
8535 int __pyx_clineno = 0;
8536 __Pyx_RefNannySetupContext(
"__repr__", 0);
8537 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
8546 __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
8547 __Pyx_XDECREF(__pyx_r);
8548 __Pyx_INCREF(__pyx_v_self->name);
8549 __pyx_r = __pyx_v_self->name;
8562 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8565 __Pyx_XGIVEREF(__pyx_r);
8566 __Pyx_TraceReturn(__pyx_r, 0);
8567 __Pyx_RefNannyFinishContext();
8578 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8579 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
8580 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8581 PyObject *__pyx_r = 0;
8582 __Pyx_RefNannyDeclarations
8583 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8584 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8587 __Pyx_RefNannyFinishContext();
8591 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8592 PyObject *__pyx_v_state = 0;
8593 PyObject *__pyx_v__dict = 0;
8594 int __pyx_v_use_setstate;
8595 PyObject *__pyx_r = NULL;
8596 __Pyx_TraceDeclarations
8597 __Pyx_RefNannyDeclarations
8598 PyObject *__pyx_t_1 = NULL;
8601 PyObject *__pyx_t_4 = NULL;
8602 PyObject *__pyx_t_5 = NULL;
8603 int __pyx_lineno = 0;
8604 const char *__pyx_filename = NULL;
8605 int __pyx_clineno = 0;
8606 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8607 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8616 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
8617 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
8618 __Pyx_GOTREF(__pyx_t_1);
8619 __Pyx_INCREF(__pyx_v_self->name);
8620 __Pyx_GIVEREF(__pyx_v_self->name);
8621 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
8622 __pyx_v_state = ((PyObject*)__pyx_t_1);
8632 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
8633 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
8634 __Pyx_GOTREF(__pyx_t_1);
8635 __pyx_v__dict = __pyx_t_1;
8645 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
8646 __pyx_t_2 = (__pyx_v__dict != Py_None);
8647 __pyx_t_3 = (__pyx_t_2 != 0);
8657 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
8658 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
8659 __Pyx_GOTREF(__pyx_t_1);
8660 __Pyx_INCREF(__pyx_v__dict);
8661 __Pyx_GIVEREF(__pyx_v__dict);
8662 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
8663 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
8664 __Pyx_GOTREF(__pyx_t_4);
8665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8666 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8676 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
8677 __pyx_v_use_setstate = 1;
8696 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
8698 __pyx_t_3 = (__pyx_v_self->name != Py_None);
8699 __pyx_v_use_setstate = __pyx_t_3;
8710 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
8711 __pyx_t_3 = (__pyx_v_use_setstate != 0);
8721 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
8722 __Pyx_XDECREF(__pyx_r);
8723 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
8724 __Pyx_GOTREF(__pyx_t_4);
8725 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
8726 __Pyx_GOTREF(__pyx_t_1);
8727 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8728 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8729 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8730 __Pyx_INCREF(__pyx_int_184977713);
8731 __Pyx_GIVEREF(__pyx_int_184977713);
8732 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8733 __Pyx_INCREF(Py_None);
8734 __Pyx_GIVEREF(Py_None);
8735 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
8736 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
8737 __Pyx_GOTREF(__pyx_t_5);
8738 __Pyx_GIVEREF(__pyx_t_4);
8739 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
8740 __Pyx_GIVEREF(__pyx_t_1);
8741 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8742 __Pyx_INCREF(__pyx_v_state);
8743 __Pyx_GIVEREF(__pyx_v_state);
8744 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8747 __pyx_r = __pyx_t_5;
8767 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
8769 __Pyx_XDECREF(__pyx_r);
8770 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
8771 __Pyx_GOTREF(__pyx_t_5);
8772 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
8773 __Pyx_GOTREF(__pyx_t_1);
8774 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8775 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8776 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8777 __Pyx_INCREF(__pyx_int_184977713);
8778 __Pyx_GIVEREF(__pyx_int_184977713);
8779 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8780 __Pyx_INCREF(__pyx_v_state);
8781 __Pyx_GIVEREF(__pyx_v_state);
8782 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8783 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
8784 __Pyx_GOTREF(__pyx_t_4);
8785 __Pyx_GIVEREF(__pyx_t_5);
8786 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8787 __Pyx_GIVEREF(__pyx_t_1);
8788 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
8791 __pyx_r = __pyx_t_4;
8804 __Pyx_XDECREF(__pyx_t_1);
8805 __Pyx_XDECREF(__pyx_t_4);
8806 __Pyx_XDECREF(__pyx_t_5);
8807 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8810 __Pyx_XDECREF(__pyx_v_state);
8811 __Pyx_XDECREF(__pyx_v__dict);
8812 __Pyx_XGIVEREF(__pyx_r);
8813 __Pyx_TraceReturn(__pyx_r, 0);
8814 __Pyx_RefNannyFinishContext();
8826 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8827 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
8828 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8829 PyObject *__pyx_r = 0;
8830 __Pyx_RefNannyDeclarations
8831 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8832 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8835 __Pyx_RefNannyFinishContext();
8839 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8840 PyObject *__pyx_r = NULL;
8841 __Pyx_TraceDeclarations
8842 __Pyx_RefNannyDeclarations
8843 PyObject *__pyx_t_1 = NULL;
8844 int __pyx_lineno = 0;
8845 const char *__pyx_filename = NULL;
8846 int __pyx_clineno = 0;
8847 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8848 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
8855 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
8856 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
8857 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8858 __Pyx_GOTREF(__pyx_t_1);
8859 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8869 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8872 __Pyx_XDECREF(__pyx_t_1);
8873 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8876 __Pyx_XGIVEREF(__pyx_r);
8877 __Pyx_TraceReturn(__pyx_r, 0);
8878 __Pyx_RefNannyFinishContext();
8890 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
8891 Py_intptr_t __pyx_v_aligned_p;
8892 size_t __pyx_v_offset;
8894 __Pyx_TraceDeclarations
8896 int __pyx_lineno = 0;
8897 const char *__pyx_filename = NULL;
8898 int __pyx_clineno = 0;
8899 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
8908 __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
8909 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8918 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8927 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
8928 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8938 __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
8939 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8957 __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
8958 __pyx_r = ((
void *)__pyx_v_aligned_p);
8971 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
8974 __Pyx_TraceReturn(Py_None, 1);
8987 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8988 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8989 PyObject *__pyx_v_obj = 0;
8991 int __pyx_v_dtype_is_object;
8992 int __pyx_lineno = 0;
8993 const char *__pyx_filename = NULL;
8994 int __pyx_clineno = 0;
8996 __Pyx_RefNannyDeclarations
8997 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8999 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9000 PyObject* values[3] = {0,0,0};
9001 if (unlikely(__pyx_kwds)) {
9003 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9005 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9007 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9009 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9012 default:
goto __pyx_L5_argtuple_error;
9014 kw_args = PyDict_Size(__pyx_kwds);
9017 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9018 else goto __pyx_L5_argtuple_error;
9021 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9023 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
9028 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9029 if (value) { values[2] = value; kw_args--; }
9032 if (unlikely(kw_args > 0)) {
9033 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
9036 switch (PyTuple_GET_SIZE(__pyx_args)) {
9037 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9039 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9040 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9042 default:
goto __pyx_L5_argtuple_error;
9045 __pyx_v_obj = values[0];
9046 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9048 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9050 __pyx_v_dtype_is_object = ((int)0);
9053 goto __pyx_L4_argument_unpacking_done;
9054 __pyx_L5_argtuple_error:;
9055 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
9057 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9058 __Pyx_RefNannyFinishContext();
9060 __pyx_L4_argument_unpacking_done:;
9061 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9064 __Pyx_RefNannyFinishContext();
9068 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
9070 __Pyx_TraceDeclarations
9071 __Pyx_RefNannyDeclarations
9076 int __pyx_lineno = 0;
9077 const char *__pyx_filename = NULL;
9078 int __pyx_clineno = 0;
9079 __Pyx_RefNannySetupContext(
"__cinit__", 0);
9080 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
9089 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
9090 __Pyx_INCREF(__pyx_v_obj);
9091 __Pyx_GIVEREF(__pyx_v_obj);
9092 __Pyx_GOTREF(__pyx_v_self->obj);
9093 __Pyx_DECREF(__pyx_v_self->obj);
9094 __pyx_v_self->obj = __pyx_v_obj;
9103 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9104 __pyx_v_self->flags = __pyx_v_flags;
9113 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9114 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9115 __pyx_t_3 = (__pyx_t_2 != 0);
9118 __pyx_t_1 = __pyx_t_3;
9119 goto __pyx_L4_bool_binop_done;
9121 __pyx_t_3 = (__pyx_v_obj != Py_None);
9122 __pyx_t_2 = (__pyx_t_3 != 0);
9123 __pyx_t_1 = __pyx_t_2;
9124 __pyx_L4_bool_binop_done:;
9134 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9135 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
9144 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9145 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9155 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9156 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9165 __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
9193 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9194 __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
9204 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9205 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9215 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9216 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9225 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9226 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9244 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9245 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9255 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9256 __pyx_v_self->lock = PyThread_allocate_lock();
9265 __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
9266 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9267 if (unlikely(__pyx_t_1)) {
9276 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9277 PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
9313 __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
9314 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9324 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
9325 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
9328 __pyx_t_1 = __pyx_t_2;
9329 goto __pyx_L12_bool_binop_done;
9331 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
9332 __pyx_t_1 = __pyx_t_2;
9333 __pyx_L12_bool_binop_done:;
9334 __pyx_v_self->dtype_is_object = __pyx_t_1;
9353 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
9355 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9366 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
9367 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
9376 __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
9377 __pyx_v_self->typeinfo = NULL;
9391 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9394 __Pyx_TraceReturn(Py_None, 0);
9395 __Pyx_RefNannyFinishContext();
9408 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
9409 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9410 __Pyx_RefNannyDeclarations
9411 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9412 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
9415 __Pyx_RefNannyFinishContext();
9418 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
9420 __Pyx_TraceDeclarations
9421 __Pyx_RefNannyDeclarations
9427 PyThread_type_lock __pyx_t_6;
9428 PyThread_type_lock __pyx_t_7;
9429 int __pyx_lineno = 0;
9430 const char *__pyx_filename = NULL;
9431 int __pyx_clineno = 0;
9432 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9433 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
9442 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
9443 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9444 __pyx_t_2 = (__pyx_t_1 != 0);
9454 __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
9455 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9474 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
9475 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9485 __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
9486 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9495 __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
9515 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
9516 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9526 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
9527 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9528 __pyx_t_4 = __pyx_t_3;
9529 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9530 __pyx_v_i = __pyx_t_5;
9539 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
9540 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9550 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
9551 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9560 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
9561 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9571 __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
9572 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9573 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9582 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
9583 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9584 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9602 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
9603 goto __pyx_L6_break;
9623 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
9624 PyThread_free_lock(__pyx_v_self->lock);
9648 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9650 __Pyx_TraceReturn(Py_None, 0);
9651 __Pyx_RefNannyFinishContext();
9662 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9663 Py_ssize_t __pyx_v_dim;
9664 char *__pyx_v_itemp;
9665 PyObject *__pyx_v_idx = NULL;
9667 __Pyx_TraceDeclarations
9668 __Pyx_RefNannyDeclarations
9669 Py_ssize_t __pyx_t_1;
9670 PyObject *__pyx_t_2 = NULL;
9671 Py_ssize_t __pyx_t_3;
9672 PyObject *(*__pyx_t_4)(PyObject *);
9673 PyObject *__pyx_t_5 = NULL;
9674 Py_ssize_t __pyx_t_6;
9676 int __pyx_lineno = 0;
9677 const char *__pyx_filename = NULL;
9678 int __pyx_clineno = 0;
9679 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
9680 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
9689 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
9690 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
9699 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
9701 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9702 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9705 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
9706 __Pyx_GOTREF(__pyx_t_2);
9707 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
9710 if (likely(!__pyx_t_4)) {
9711 if (likely(PyList_CheckExact(__pyx_t_2))) {
9712 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
9713 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9714 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
9716 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
9717 __Pyx_GOTREF(__pyx_t_5);
9720 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
9721 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9722 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
9724 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
9725 __Pyx_GOTREF(__pyx_t_5);
9729 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9730 if (unlikely(!__pyx_t_5)) {
9731 PyObject* exc_type = PyErr_Occurred();
9733 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9734 else __PYX_ERR(1, 399, __pyx_L1_error)
9738 __Pyx_GOTREF(__pyx_t_5);
9740 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9742 __pyx_v_dim = __pyx_t_1;
9743 __pyx_t_1 = (__pyx_t_1 + 1);
9752 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
9753 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
9754 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
9755 __pyx_v_itemp = __pyx_t_7;
9764 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
9766 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9775 __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
9776 __pyx_r = __pyx_v_itemp;
9789 __Pyx_XDECREF(__pyx_t_2);
9790 __Pyx_XDECREF(__pyx_t_5);
9791 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9794 __Pyx_XDECREF(__pyx_v_idx);
9795 __Pyx_TraceReturn(Py_None, 0);
9796 __Pyx_RefNannyFinishContext();
9809 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
9810 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9811 PyObject *__pyx_r = 0;
9812 __Pyx_RefNannyDeclarations
9813 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9814 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9817 __Pyx_RefNannyFinishContext();
9821 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9822 PyObject *__pyx_v_have_slices = NULL;
9823 PyObject *__pyx_v_indices = NULL;
9824 char *__pyx_v_itemp;
9825 PyObject *__pyx_r = NULL;
9826 __Pyx_TraceDeclarations
9827 __Pyx_RefNannyDeclarations
9830 PyObject *__pyx_t_3 = NULL;
9831 PyObject *__pyx_t_4 = NULL;
9832 PyObject *__pyx_t_5 = NULL;
9834 int __pyx_lineno = 0;
9835 const char *__pyx_filename = NULL;
9836 int __pyx_clineno = 0;
9837 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9838 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
9847 __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
9848 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9849 __pyx_t_2 = (__pyx_t_1 != 0);
9859 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
9860 __Pyx_XDECREF(__pyx_r);
9861 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9862 __pyx_r = ((PyObject *)__pyx_v_self);
9881 __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
9882 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
9883 __Pyx_GOTREF(__pyx_t_3);
9884 if (likely(__pyx_t_3 != Py_None)) {
9885 PyObject* sequence = __pyx_t_3;
9886 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9887 if (unlikely(size != 2)) {
9888 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9889 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9890 __PYX_ERR(1, 409, __pyx_L1_error)
9892 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9893 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9894 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9895 __Pyx_INCREF(__pyx_t_4);
9896 __Pyx_INCREF(__pyx_t_5);
9898 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
9899 __Pyx_GOTREF(__pyx_t_4);
9900 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
9901 __Pyx_GOTREF(__pyx_t_5);
9903 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9905 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
9907 __pyx_v_have_slices = __pyx_t_4;
9909 __pyx_v_indices = __pyx_t_5;
9919 __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
9920 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
9930 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
9931 __Pyx_XDECREF(__pyx_r);
9932 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
9933 __Pyx_GOTREF(__pyx_t_3);
9934 __pyx_r = __pyx_t_3;
9954 __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
9956 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
9957 __pyx_v_itemp = __pyx_t_6;
9966 __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
9967 __Pyx_XDECREF(__pyx_r);
9968 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
9969 __Pyx_GOTREF(__pyx_t_3);
9970 __pyx_r = __pyx_t_3;
9985 __Pyx_XDECREF(__pyx_t_3);
9986 __Pyx_XDECREF(__pyx_t_4);
9987 __Pyx_XDECREF(__pyx_t_5);
9988 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9991 __Pyx_XDECREF(__pyx_v_have_slices);
9992 __Pyx_XDECREF(__pyx_v_indices);
9993 __Pyx_XGIVEREF(__pyx_r);
9994 __Pyx_TraceReturn(__pyx_r, 0);
9995 __Pyx_RefNannyFinishContext();
10008 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
10009 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10011 __Pyx_RefNannyDeclarations
10012 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10013 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10016 __Pyx_RefNannyFinishContext();
10020 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10021 PyObject *__pyx_v_have_slices = NULL;
10022 PyObject *__pyx_v_obj = NULL;
10024 __Pyx_TraceDeclarations
10025 __Pyx_RefNannyDeclarations
10027 PyObject *__pyx_t_2 = NULL;
10028 PyObject *__pyx_t_3 = NULL;
10029 PyObject *__pyx_t_4 = NULL;
10030 int __pyx_lineno = 0;
10031 const char *__pyx_filename = NULL;
10032 int __pyx_clineno = 0;
10033 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10034 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
10035 __Pyx_INCREF(__pyx_v_index);
10044 __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
10045 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10046 if (unlikely(__pyx_t_1)) {
10055 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
10056 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10057 __Pyx_GOTREF(__pyx_t_2);
10058 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10059 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10060 __PYX_ERR(1, 420, __pyx_L1_error)
10078 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
10079 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
10080 __Pyx_GOTREF(__pyx_t_2);
10081 if (likely(__pyx_t_2 != Py_None)) {
10082 PyObject* sequence = __pyx_t_2;
10083 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10084 if (unlikely(size != 2)) {
10085 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10086 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10087 __PYX_ERR(1, 422, __pyx_L1_error)
10089 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10090 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10091 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10092 __Pyx_INCREF(__pyx_t_3);
10093 __Pyx_INCREF(__pyx_t_4);
10095 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
10096 __Pyx_GOTREF(__pyx_t_3);
10097 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
10098 __Pyx_GOTREF(__pyx_t_4);
10100 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10102 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
10104 __pyx_v_have_slices = __pyx_t_3;
10106 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10116 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10117 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10127 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10128 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10129 __Pyx_GOTREF(__pyx_t_2);
10130 __pyx_v_obj = __pyx_t_2;
10140 __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
10141 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
10151 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10152 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10153 __Pyx_GOTREF(__pyx_t_2);
10154 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10155 __Pyx_GOTREF(__pyx_t_4);
10156 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10157 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10176 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10178 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
10179 __Pyx_GOTREF(__pyx_t_4);
10180 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
10181 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10182 __Pyx_GOTREF(__pyx_t_2);
10183 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10205 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
10207 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
10208 __Pyx_GOTREF(__pyx_t_2);
10209 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10225 __Pyx_XDECREF(__pyx_t_2);
10226 __Pyx_XDECREF(__pyx_t_3);
10227 __Pyx_XDECREF(__pyx_t_4);
10228 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10231 __Pyx_XDECREF(__pyx_v_have_slices);
10232 __Pyx_XDECREF(__pyx_v_obj);
10233 __Pyx_XDECREF(__pyx_v_index);
10234 __Pyx_TraceReturn(Py_None, 0);
10235 __Pyx_RefNannyFinishContext();
10247 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10248 PyObject *__pyx_r = NULL;
10249 __Pyx_TraceDeclarations
10250 __Pyx_RefNannyDeclarations
10253 PyObject *__pyx_t_3 = NULL;
10254 PyObject *__pyx_t_4 = NULL;
10255 PyObject *__pyx_t_5 = NULL;
10256 PyObject *__pyx_t_6 = NULL;
10257 PyObject *__pyx_t_7 = NULL;
10258 PyObject *__pyx_t_8 = NULL;
10260 int __pyx_lineno = 0;
10261 const char *__pyx_filename = NULL;
10262 int __pyx_clineno = 0;
10263 __Pyx_RefNannySetupContext(
"is_slice", 0);
10264 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
10265 __Pyx_INCREF(__pyx_v_obj);
10274 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
10275 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10276 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10286 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
10288 __Pyx_PyThreadState_declare
10289 __Pyx_PyThreadState_assign
10290 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10291 __Pyx_XGOTREF(__pyx_t_3);
10292 __Pyx_XGOTREF(__pyx_t_4);
10293 __Pyx_XGOTREF(__pyx_t_5);
10303 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10304 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
10305 __Pyx_GOTREF(__pyx_t_6);
10314 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
10315 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
10316 __Pyx_GOTREF(__pyx_t_7);
10325 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10326 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
10327 __Pyx_GOTREF(__pyx_t_8);
10328 __Pyx_INCREF(__pyx_v_obj);
10329 __Pyx_GIVEREF(__pyx_v_obj);
10330 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10331 __Pyx_GIVEREF(__pyx_t_6);
10332 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10333 __Pyx_GIVEREF(__pyx_t_7);
10334 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10337 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
10338 __Pyx_GOTREF(__pyx_t_7);
10339 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10340 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10351 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10352 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10353 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10354 goto __pyx_L9_try_end;
10356 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10357 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10358 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10367 __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
10368 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10370 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10371 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
10372 __Pyx_GOTREF(__pyx_t_7);
10373 __Pyx_GOTREF(__pyx_t_8);
10374 __Pyx_GOTREF(__pyx_t_6);
10383 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
10384 __Pyx_XDECREF(__pyx_r);
10385 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10386 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10387 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10388 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10389 goto __pyx_L7_except_return;
10391 goto __pyx_L6_except_error;
10392 __pyx_L6_except_error:;
10401 __Pyx_XGIVEREF(__pyx_t_3);
10402 __Pyx_XGIVEREF(__pyx_t_4);
10403 __Pyx_XGIVEREF(__pyx_t_5);
10404 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10405 goto __pyx_L1_error;
10406 __pyx_L7_except_return:;
10407 __Pyx_XGIVEREF(__pyx_t_3);
10408 __Pyx_XGIVEREF(__pyx_t_4);
10409 __Pyx_XGIVEREF(__pyx_t_5);
10410 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10431 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
10432 __Pyx_XDECREF(__pyx_r);
10433 __Pyx_INCREF(__pyx_v_obj);
10434 __pyx_r = __pyx_v_obj;
10447 __Pyx_XDECREF(__pyx_t_6);
10448 __Pyx_XDECREF(__pyx_t_7);
10449 __Pyx_XDECREF(__pyx_t_8);
10450 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10453 __Pyx_XDECREF(__pyx_v_obj);
10454 __Pyx_XGIVEREF(__pyx_r);
10455 __Pyx_TraceReturn(__pyx_r, 0);
10456 __Pyx_RefNannyFinishContext();
10468 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10469 __Pyx_memviewslice __pyx_v_dst_slice;
10470 __Pyx_memviewslice __pyx_v_src_slice;
10471 PyObject *__pyx_r = NULL;
10472 __Pyx_TraceDeclarations
10473 __Pyx_RefNannyDeclarations
10474 __Pyx_memviewslice *__pyx_t_1;
10475 __Pyx_memviewslice *__pyx_t_2;
10476 PyObject *__pyx_t_3 = NULL;
10480 int __pyx_lineno = 0;
10481 const char *__pyx_filename = NULL;
10482 int __pyx_clineno = 0;
10483 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
10484 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
10493 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
10494 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
10495 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
10504 __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
10505 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
10506 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
10515 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
10516 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
10517 __Pyx_GOTREF(__pyx_t_3);
10518 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
10519 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10520 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
10521 __Pyx_GOTREF(__pyx_t_3);
10522 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
10523 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10532 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
10533 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
10544 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10547 __Pyx_XDECREF(__pyx_t_3);
10548 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10551 __Pyx_XGIVEREF(__pyx_r);
10552 __Pyx_TraceReturn(__pyx_r, 0);
10553 __Pyx_RefNannyFinishContext();
10565 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10566 int __pyx_v_array[0x80];
10568 void *__pyx_v_item;
10569 __Pyx_memviewslice *__pyx_v_dst_slice;
10570 __Pyx_memviewslice __pyx_v_tmp_slice;
10571 PyObject *__pyx_r = NULL;
10572 __Pyx_TraceDeclarations
10573 __Pyx_RefNannyDeclarations
10574 __Pyx_memviewslice *__pyx_t_1;
10576 PyObject *__pyx_t_3 = NULL;
10579 char const *__pyx_t_6;
10580 PyObject *__pyx_t_7 = NULL;
10581 PyObject *__pyx_t_8 = NULL;
10582 PyObject *__pyx_t_9 = NULL;
10583 PyObject *__pyx_t_10 = NULL;
10584 PyObject *__pyx_t_11 = NULL;
10585 PyObject *__pyx_t_12 = NULL;
10586 int __pyx_lineno = 0;
10587 const char *__pyx_filename = NULL;
10588 int __pyx_clineno = 0;
10589 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
10590 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
10599 __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
10600 __pyx_v_tmp = NULL;
10609 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
10610 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
10611 __pyx_v_dst_slice = __pyx_t_1;
10620 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
10621 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
10631 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
10632 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10641 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
10642 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
10643 if (unlikely(__pyx_t_2)) {
10652 __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
10653 PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
10671 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
10672 __pyx_v_item = __pyx_v_tmp;
10691 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
10693 __pyx_v_item = ((
void *)__pyx_v_array);
10704 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
10714 __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
10715 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
10725 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
10726 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10745 __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
10747 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
10748 __Pyx_GOTREF(__pyx_t_3);
10749 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10760 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
10761 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
10771 __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
10772 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
10773 __Pyx_GOTREF(__pyx_t_3);
10774 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10792 __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
10793 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10803 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
10806 PyMem_Free(__pyx_v_tmp);
10811 __Pyx_PyThreadState_declare
10812 __Pyx_PyThreadState_assign
10813 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10814 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10815 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10816 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10817 __Pyx_XGOTREF(__pyx_t_7);
10818 __Pyx_XGOTREF(__pyx_t_8);
10819 __Pyx_XGOTREF(__pyx_t_9);
10820 __Pyx_XGOTREF(__pyx_t_10);
10821 __Pyx_XGOTREF(__pyx_t_11);
10822 __Pyx_XGOTREF(__pyx_t_12);
10823 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10825 PyMem_Free(__pyx_v_tmp);
10827 if (PY_MAJOR_VERSION >= 3) {
10828 __Pyx_XGIVEREF(__pyx_t_10);
10829 __Pyx_XGIVEREF(__pyx_t_11);
10830 __Pyx_XGIVEREF(__pyx_t_12);
10831 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10833 __Pyx_XGIVEREF(__pyx_t_7);
10834 __Pyx_XGIVEREF(__pyx_t_8);
10835 __Pyx_XGIVEREF(__pyx_t_9);
10836 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10837 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10838 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10839 goto __pyx_L1_error;
10853 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10856 __Pyx_XDECREF(__pyx_t_3);
10857 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10860 __Pyx_XGIVEREF(__pyx_r);
10861 __Pyx_TraceReturn(__pyx_r, 0);
10862 __Pyx_RefNannyFinishContext();
10874 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10875 char *__pyx_v_itemp;
10876 PyObject *__pyx_r = NULL;
10877 __Pyx_TraceDeclarations
10878 __Pyx_RefNannyDeclarations
10880 PyObject *__pyx_t_2 = NULL;
10881 int __pyx_lineno = 0;
10882 const char *__pyx_filename = NULL;
10883 int __pyx_clineno = 0;
10884 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
10885 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
10894 __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
10895 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
10896 __pyx_v_itemp = __pyx_t_1;
10905 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
10906 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
10907 __Pyx_GOTREF(__pyx_t_2);
10908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10919 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10922 __Pyx_XDECREF(__pyx_t_2);
10923 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10926 __Pyx_XGIVEREF(__pyx_r);
10927 __Pyx_TraceReturn(__pyx_r, 0);
10928 __Pyx_RefNannyFinishContext();
10940 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
10941 PyObject *__pyx_v_struct = NULL;
10942 PyObject *__pyx_v_bytesitem = 0;
10943 PyObject *__pyx_v_result = NULL;
10944 PyObject *__pyx_r = NULL;
10945 __Pyx_TraceDeclarations
10946 __Pyx_RefNannyDeclarations
10947 PyObject *__pyx_t_1 = NULL;
10948 PyObject *__pyx_t_2 = NULL;
10949 PyObject *__pyx_t_3 = NULL;
10950 PyObject *__pyx_t_4 = NULL;
10951 PyObject *__pyx_t_5 = NULL;
10952 PyObject *__pyx_t_6 = NULL;
10953 PyObject *__pyx_t_7 = NULL;
10955 PyObject *__pyx_t_9 = NULL;
10958 int __pyx_lineno = 0;
10959 const char *__pyx_filename = NULL;
10960 int __pyx_clineno = 0;
10961 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
10962 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
10971 __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
10972 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
10973 __Pyx_GOTREF(__pyx_t_1);
10974 __pyx_v_struct = __pyx_t_1;
10984 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
10985 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
10986 __Pyx_GOTREF(__pyx_t_1);
10987 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10997 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
10999 __Pyx_PyThreadState_declare
11000 __Pyx_PyThreadState_assign
11001 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11002 __Pyx_XGOTREF(__pyx_t_2);
11003 __Pyx_XGOTREF(__pyx_t_3);
11004 __Pyx_XGOTREF(__pyx_t_4);
11014 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
11015 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
11016 __Pyx_GOTREF(__pyx_t_5);
11017 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
11018 __Pyx_GOTREF(__pyx_t_6);
11021 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11022 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11023 if (likely(__pyx_t_7)) {
11024 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11025 __Pyx_INCREF(__pyx_t_7);
11026 __Pyx_INCREF(
function);
11027 __Pyx_DECREF_SET(__pyx_t_5,
function);
11031 #if CYTHON_FAST_PYCALL
11032 if (PyFunction_Check(__pyx_t_5)) {
11033 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11034 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11035 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11036 __Pyx_GOTREF(__pyx_t_1);
11037 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11040 #if CYTHON_FAST_PYCCALL
11041 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11042 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11043 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11044 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11045 __Pyx_GOTREF(__pyx_t_1);
11046 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11050 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
11051 __Pyx_GOTREF(__pyx_t_9);
11053 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11055 __Pyx_GIVEREF(__pyx_t_6);
11056 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11057 __Pyx_INCREF(__pyx_v_bytesitem);
11058 __Pyx_GIVEREF(__pyx_v_bytesitem);
11059 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11061 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11062 __Pyx_GOTREF(__pyx_t_1);
11063 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11065 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11066 __pyx_v_result = __pyx_t_1;
11085 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
11087 __pyx_t_10 = strlen(__pyx_v_self->view.format);
11088 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11098 __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
11099 __Pyx_XDECREF(__pyx_r);
11100 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
11101 __Pyx_GOTREF(__pyx_t_1);
11102 __pyx_r = __pyx_t_1;
11104 goto __pyx_L6_except_return;
11122 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
11123 __Pyx_XDECREF(__pyx_r);
11124 __Pyx_INCREF(__pyx_v_result);
11125 __pyx_r = __pyx_v_result;
11126 goto __pyx_L6_except_return;
11129 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11130 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11131 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11132 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11133 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11142 __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
11143 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11144 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
11145 __Pyx_GOTREF(__pyx_t_6);
11146 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11147 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11148 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11149 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11151 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11152 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
11153 __Pyx_GOTREF(__pyx_t_9);
11154 __Pyx_GOTREF(__pyx_t_5);
11155 __Pyx_GOTREF(__pyx_t_1);
11164 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11165 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
11166 __Pyx_GOTREF(__pyx_t_6);
11167 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11168 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11169 __PYX_ERR(1, 497, __pyx_L5_except_error)
11171 goto __pyx_L5_except_error;
11172 __pyx_L5_except_error:;
11181 __Pyx_XGIVEREF(__pyx_t_2);
11182 __Pyx_XGIVEREF(__pyx_t_3);
11183 __Pyx_XGIVEREF(__pyx_t_4);
11184 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11185 goto __pyx_L1_error;
11186 __pyx_L6_except_return:;
11187 __Pyx_XGIVEREF(__pyx_t_2);
11188 __Pyx_XGIVEREF(__pyx_t_3);
11189 __Pyx_XGIVEREF(__pyx_t_4);
11190 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11204 __Pyx_XDECREF(__pyx_t_1);
11205 __Pyx_XDECREF(__pyx_t_5);
11206 __Pyx_XDECREF(__pyx_t_6);
11207 __Pyx_XDECREF(__pyx_t_7);
11208 __Pyx_XDECREF(__pyx_t_9);
11209 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11212 __Pyx_XDECREF(__pyx_v_struct);
11213 __Pyx_XDECREF(__pyx_v_bytesitem);
11214 __Pyx_XDECREF(__pyx_v_result);
11215 __Pyx_XGIVEREF(__pyx_r);
11216 __Pyx_TraceReturn(__pyx_r, 0);
11217 __Pyx_RefNannyFinishContext();
11229 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11230 PyObject *__pyx_v_struct = NULL;
11232 PyObject *__pyx_v_bytesvalue = 0;
11233 Py_ssize_t __pyx_v_i;
11234 PyObject *__pyx_r = NULL;
11235 __Pyx_TraceDeclarations
11236 __Pyx_RefNannyDeclarations
11237 PyObject *__pyx_t_1 = NULL;
11240 PyObject *__pyx_t_4 = NULL;
11241 PyObject *__pyx_t_5 = NULL;
11242 PyObject *__pyx_t_6 = NULL;
11244 PyObject *__pyx_t_8 = NULL;
11245 Py_ssize_t __pyx_t_9;
11246 PyObject *__pyx_t_10 = NULL;
11251 int __pyx_lineno = 0;
11252 const char *__pyx_filename = NULL;
11253 int __pyx_clineno = 0;
11254 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
11255 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
11264 __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
11265 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
11266 __Pyx_GOTREF(__pyx_t_1);
11267 __pyx_v_struct = __pyx_t_1;
11277 __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
11278 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11279 __pyx_t_3 = (__pyx_t_2 != 0);
11289 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11290 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11291 __Pyx_GOTREF(__pyx_t_1);
11292 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11293 __Pyx_GOTREF(__pyx_t_4);
11294 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
11295 __Pyx_GOTREF(__pyx_t_5);
11296 __Pyx_GIVEREF(__pyx_t_4);
11297 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11299 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11300 __Pyx_GOTREF(__pyx_t_4);
11301 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11302 __Pyx_GOTREF(__pyx_t_6);
11303 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11304 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11305 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11306 __Pyx_GOTREF(__pyx_t_4);
11307 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11308 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11309 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11310 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11330 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11332 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
11333 __Pyx_GOTREF(__pyx_t_6);
11334 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
11335 __Pyx_GOTREF(__pyx_t_1);
11338 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11339 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11340 if (likely(__pyx_t_5)) {
11341 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
11342 __Pyx_INCREF(__pyx_t_5);
11343 __Pyx_INCREF(
function);
11344 __Pyx_DECREF_SET(__pyx_t_6,
function);
11348 #if CYTHON_FAST_PYCALL
11349 if (PyFunction_Check(__pyx_t_6)) {
11350 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11351 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11352 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11353 __Pyx_GOTREF(__pyx_t_4);
11354 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11357 #if CYTHON_FAST_PYCCALL
11358 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11359 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11360 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11361 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11362 __Pyx_GOTREF(__pyx_t_4);
11363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11367 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
11368 __Pyx_GOTREF(__pyx_t_8);
11370 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11372 __Pyx_GIVEREF(__pyx_t_1);
11373 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11374 __Pyx_INCREF(__pyx_v_value);
11375 __Pyx_GIVEREF(__pyx_v_value);
11376 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11378 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11379 __Pyx_GOTREF(__pyx_t_4);
11380 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11382 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11383 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
11384 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11396 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
11398 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11399 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
11400 __PYX_ERR(1, 516, __pyx_L1_error)
11402 __Pyx_INCREF(__pyx_v_bytesvalue);
11403 __pyx_t_10 = __pyx_v_bytesvalue;
11404 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11405 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11406 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11407 __pyx_t_11 = __pyx_t_14;
11408 __pyx_v_c = (__pyx_t_11[0]);
11417 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
11418 __pyx_v_i = __pyx_t_9;
11427 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
11428 __pyx_t_9 = (__pyx_t_9 + 1);
11437 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
11438 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11440 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11451 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11454 __Pyx_XDECREF(__pyx_t_1);
11455 __Pyx_XDECREF(__pyx_t_4);
11456 __Pyx_XDECREF(__pyx_t_5);
11457 __Pyx_XDECREF(__pyx_t_6);
11458 __Pyx_XDECREF(__pyx_t_8);
11459 __Pyx_XDECREF(__pyx_t_10);
11460 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11463 __Pyx_XDECREF(__pyx_v_struct);
11464 __Pyx_XDECREF(__pyx_v_bytesvalue);
11465 __Pyx_XGIVEREF(__pyx_r);
11466 __Pyx_TraceReturn(__pyx_r, 0);
11467 __Pyx_RefNannyFinishContext();
11480 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
11481 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11483 __Pyx_RefNannyDeclarations
11484 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
11485 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
11488 __Pyx_RefNannyFinishContext();
11492 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11494 __Pyx_TraceDeclarations
11495 __Pyx_RefNannyDeclarations
11498 PyObject *__pyx_t_3 = NULL;
11499 Py_ssize_t *__pyx_t_4;
11503 Py_ssize_t __pyx_t_8;
11504 int __pyx_lineno = 0;
11505 const char *__pyx_filename = NULL;
11506 int __pyx_clineno = 0;
11507 if (__pyx_v_info == NULL) {
11508 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
11511 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
11512 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11513 __Pyx_GIVEREF(__pyx_v_info->obj);
11514 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
11523 __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
11524 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11527 __pyx_t_1 = __pyx_t_2;
11528 goto __pyx_L4_bool_binop_done;
11530 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11531 __pyx_t_1 = __pyx_t_2;
11532 __pyx_L4_bool_binop_done:;
11533 if (unlikely(__pyx_t_1)) {
11542 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
11543 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
11544 __Pyx_GOTREF(__pyx_t_3);
11545 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11546 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11547 __PYX_ERR(1, 522, __pyx_L1_error)
11565 __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
11566 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11576 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
11577 __pyx_t_4 = __pyx_v_self->view.shape;
11578 __pyx_v_info->shape = __pyx_t_4;
11597 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
11599 __pyx_v_info->shape = NULL;
11610 __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
11611 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11621 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
11622 __pyx_t_4 = __pyx_v_self->view.strides;
11623 __pyx_v_info->strides = __pyx_t_4;
11642 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
11644 __pyx_v_info->strides = NULL;
11655 __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
11656 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11666 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
11667 __pyx_t_4 = __pyx_v_self->view.suboffsets;
11668 __pyx_v_info->suboffsets = __pyx_t_4;
11687 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
11689 __pyx_v_info->suboffsets = NULL;
11700 __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
11701 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11711 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
11712 __pyx_t_5 = __pyx_v_self->view.format;
11713 __pyx_v_info->format = __pyx_t_5;
11732 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
11734 __pyx_v_info->format = NULL;
11745 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
11746 __pyx_t_6 = __pyx_v_self->view.buf;
11747 __pyx_v_info->buf = __pyx_t_6;
11756 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
11757 __pyx_t_7 = __pyx_v_self->view.ndim;
11758 __pyx_v_info->ndim = __pyx_t_7;
11767 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
11768 __pyx_t_8 = __pyx_v_self->view.itemsize;
11769 __pyx_v_info->itemsize = __pyx_t_8;
11778 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
11779 __pyx_t_8 = __pyx_v_self->view.len;
11780 __pyx_v_info->len = __pyx_t_8;
11789 __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
11790 __pyx_t_1 = __pyx_v_self->view.readonly;
11791 __pyx_v_info->readonly = __pyx_t_1;
11800 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
11801 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11802 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11803 __Pyx_GOTREF(__pyx_v_info->obj);
11804 __Pyx_DECREF(__pyx_v_info->obj);
11805 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11819 __Pyx_XDECREF(__pyx_t_3);
11820 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11822 if (__pyx_v_info->obj != NULL) {
11823 __Pyx_GOTREF(__pyx_v_info->obj);
11824 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11828 if (__pyx_v_info->obj == Py_None) {
11829 __Pyx_GOTREF(__pyx_v_info->obj);
11830 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11833 __Pyx_TraceReturn(Py_None, 0);
11834 __Pyx_RefNannyFinishContext();
11847 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
11848 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11849 PyObject *__pyx_r = 0;
11850 __Pyx_RefNannyDeclarations
11851 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11852 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11855 __Pyx_RefNannyFinishContext();
11859 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11860 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11861 PyObject *__pyx_r = NULL;
11862 __Pyx_TraceDeclarations
11863 __Pyx_RefNannyDeclarations
11864 PyObject *__pyx_t_1 = NULL;
11866 int __pyx_lineno = 0;
11867 const char *__pyx_filename = NULL;
11868 int __pyx_clineno = 0;
11869 __Pyx_RefNannySetupContext(
"__get__", 0);
11870 __Pyx_TraceCall(
"__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
11879 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
11880 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
11881 __Pyx_GOTREF(__pyx_t_1);
11882 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
11883 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11893 __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
11894 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
11903 __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
11904 __Pyx_XDECREF(__pyx_r);
11905 __Pyx_INCREF(((PyObject *)__pyx_v_result));
11906 __pyx_r = ((PyObject *)__pyx_v_result);
11919 __Pyx_XDECREF(__pyx_t_1);
11920 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11923 __Pyx_XDECREF((PyObject *)__pyx_v_result);
11924 __Pyx_XGIVEREF(__pyx_r);
11925 __Pyx_TraceReturn(__pyx_r, 0);
11926 __Pyx_RefNannyFinishContext();
11939 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
11940 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11941 PyObject *__pyx_r = 0;
11942 __Pyx_RefNannyDeclarations
11943 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11944 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11947 __Pyx_RefNannyFinishContext();
11951 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11952 PyObject *__pyx_r = NULL;
11953 __Pyx_TraceDeclarations
11954 __Pyx_RefNannyDeclarations
11955 int __pyx_lineno = 0;
11956 const char *__pyx_filename = NULL;
11957 int __pyx_clineno = 0;
11958 __Pyx_RefNannySetupContext(
"__get__", 0);
11959 __Pyx_TraceCall(
"__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
11968 __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
11969 __Pyx_XDECREF(__pyx_r);
11970 __Pyx_INCREF(__pyx_v_self->obj);
11971 __pyx_r = __pyx_v_self->obj;
11984 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11987 __Pyx_XGIVEREF(__pyx_r);
11988 __Pyx_TraceReturn(__pyx_r, 0);
11989 __Pyx_RefNannyFinishContext();
12002 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
12003 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12004 PyObject *__pyx_r = 0;
12005 __Pyx_RefNannyDeclarations
12006 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12007 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12010 __Pyx_RefNannyFinishContext();
12014 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12015 Py_ssize_t __pyx_v_length;
12016 PyObject *__pyx_r = NULL;
12017 __Pyx_TraceDeclarations
12018 __Pyx_RefNannyDeclarations
12019 PyObject *__pyx_t_1 = NULL;
12020 Py_ssize_t *__pyx_t_2;
12021 Py_ssize_t *__pyx_t_3;
12022 Py_ssize_t *__pyx_t_4;
12023 PyObject *__pyx_t_5 = NULL;
12024 int __pyx_lineno = 0;
12025 const char *__pyx_filename = NULL;
12026 int __pyx_clineno = 0;
12027 __Pyx_RefNannySetupContext(
"__get__", 0);
12028 __Pyx_TraceCall(
"__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
12037 __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
12038 __Pyx_XDECREF(__pyx_r);
12039 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
12040 __Pyx_GOTREF(__pyx_t_1);
12041 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12042 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12043 __pyx_t_2 = __pyx_t_4;
12044 __pyx_v_length = (__pyx_t_2[0]);
12045 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12046 __Pyx_GOTREF(__pyx_t_5);
12047 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
12048 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12050 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12051 __Pyx_GOTREF(__pyx_t_5);
12052 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12053 __pyx_r = __pyx_t_5;
12067 __Pyx_XDECREF(__pyx_t_1);
12068 __Pyx_XDECREF(__pyx_t_5);
12069 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12072 __Pyx_XGIVEREF(__pyx_r);
12073 __Pyx_TraceReturn(__pyx_r, 0);
12074 __Pyx_RefNannyFinishContext();
12087 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
12088 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12089 PyObject *__pyx_r = 0;
12090 __Pyx_RefNannyDeclarations
12091 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12092 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12095 __Pyx_RefNannyFinishContext();
12099 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12100 Py_ssize_t __pyx_v_stride;
12101 PyObject *__pyx_r = NULL;
12102 __Pyx_TraceDeclarations
12103 __Pyx_RefNannyDeclarations
12105 PyObject *__pyx_t_2 = NULL;
12106 Py_ssize_t *__pyx_t_3;
12107 Py_ssize_t *__pyx_t_4;
12108 Py_ssize_t *__pyx_t_5;
12109 PyObject *__pyx_t_6 = NULL;
12110 int __pyx_lineno = 0;
12111 const char *__pyx_filename = NULL;
12112 int __pyx_clineno = 0;
12113 __Pyx_RefNannySetupContext(
"__get__", 0);
12114 __Pyx_TraceCall(
"__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
12123 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12124 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12125 if (unlikely(__pyx_t_1)) {
12134 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12135 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12136 __Pyx_GOTREF(__pyx_t_2);
12137 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12138 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12139 __PYX_ERR(1, 572, __pyx_L1_error)
12157 __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
12158 __Pyx_XDECREF(__pyx_r);
12159 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
12160 __Pyx_GOTREF(__pyx_t_2);
12161 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12162 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12163 __pyx_t_3 = __pyx_t_5;
12164 __pyx_v_stride = (__pyx_t_3[0]);
12165 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12166 __Pyx_GOTREF(__pyx_t_6);
12167 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
12168 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12170 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12171 __Pyx_GOTREF(__pyx_t_6);
12172 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12173 __pyx_r = __pyx_t_6;
12187 __Pyx_XDECREF(__pyx_t_2);
12188 __Pyx_XDECREF(__pyx_t_6);
12189 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12192 __Pyx_XGIVEREF(__pyx_r);
12193 __Pyx_TraceReturn(__pyx_r, 0);
12194 __Pyx_RefNannyFinishContext();
12207 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
12208 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12209 PyObject *__pyx_r = 0;
12210 __Pyx_RefNannyDeclarations
12211 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12212 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12215 __Pyx_RefNannyFinishContext();
12219 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12220 Py_ssize_t __pyx_v_suboffset;
12221 PyObject *__pyx_r = NULL;
12222 __Pyx_TraceDeclarations
12223 __Pyx_RefNannyDeclarations
12225 PyObject *__pyx_t_2 = NULL;
12226 PyObject *__pyx_t_3 = NULL;
12227 Py_ssize_t *__pyx_t_4;
12228 Py_ssize_t *__pyx_t_5;
12229 Py_ssize_t *__pyx_t_6;
12230 int __pyx_lineno = 0;
12231 const char *__pyx_filename = NULL;
12232 int __pyx_clineno = 0;
12233 __Pyx_RefNannySetupContext(
"__get__", 0);
12234 __Pyx_TraceCall(
"__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
12243 __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
12244 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12254 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12255 __Pyx_XDECREF(__pyx_r);
12256 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12257 __Pyx_GOTREF(__pyx_t_2);
12258 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12259 __Pyx_GOTREF(__pyx_t_3);
12260 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12261 __pyx_r = __pyx_t_3;
12281 __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
12282 __Pyx_XDECREF(__pyx_r);
12283 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
12284 __Pyx_GOTREF(__pyx_t_3);
12285 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12286 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12287 __pyx_t_4 = __pyx_t_6;
12288 __pyx_v_suboffset = (__pyx_t_4[0]);
12289 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12290 __Pyx_GOTREF(__pyx_t_2);
12291 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
12292 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12294 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12295 __Pyx_GOTREF(__pyx_t_2);
12296 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12297 __pyx_r = __pyx_t_2;
12311 __Pyx_XDECREF(__pyx_t_2);
12312 __Pyx_XDECREF(__pyx_t_3);
12313 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12316 __Pyx_XGIVEREF(__pyx_r);
12317 __Pyx_TraceReturn(__pyx_r, 0);
12318 __Pyx_RefNannyFinishContext();
12331 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
12332 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12333 PyObject *__pyx_r = 0;
12334 __Pyx_RefNannyDeclarations
12335 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12336 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12339 __Pyx_RefNannyFinishContext();
12343 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12344 PyObject *__pyx_r = NULL;
12345 __Pyx_TraceDeclarations
12346 __Pyx_RefNannyDeclarations
12347 PyObject *__pyx_t_1 = NULL;
12348 int __pyx_lineno = 0;
12349 const char *__pyx_filename = NULL;
12350 int __pyx_clineno = 0;
12351 __Pyx_RefNannySetupContext(
"__get__", 0);
12352 __Pyx_TraceCall(
"__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
12361 __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
12362 __Pyx_XDECREF(__pyx_r);
12363 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
12364 __Pyx_GOTREF(__pyx_t_1);
12365 __pyx_r = __pyx_t_1;
12379 __Pyx_XDECREF(__pyx_t_1);
12380 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12383 __Pyx_XGIVEREF(__pyx_r);
12384 __Pyx_TraceReturn(__pyx_r, 0);
12385 __Pyx_RefNannyFinishContext();
12398 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
12399 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12400 PyObject *__pyx_r = 0;
12401 __Pyx_RefNannyDeclarations
12402 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12403 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12406 __Pyx_RefNannyFinishContext();
12410 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12411 PyObject *__pyx_r = NULL;
12412 __Pyx_TraceDeclarations
12413 __Pyx_RefNannyDeclarations
12414 PyObject *__pyx_t_1 = NULL;
12415 int __pyx_lineno = 0;
12416 const char *__pyx_filename = NULL;
12417 int __pyx_clineno = 0;
12418 __Pyx_RefNannySetupContext(
"__get__", 0);
12419 __Pyx_TraceCall(
"__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
12428 __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
12429 __Pyx_XDECREF(__pyx_r);
12430 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
12431 __Pyx_GOTREF(__pyx_t_1);
12432 __pyx_r = __pyx_t_1;
12446 __Pyx_XDECREF(__pyx_t_1);
12447 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12450 __Pyx_XGIVEREF(__pyx_r);
12451 __Pyx_TraceReturn(__pyx_r, 0);
12452 __Pyx_RefNannyFinishContext();
12465 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
12466 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12467 PyObject *__pyx_r = 0;
12468 __Pyx_RefNannyDeclarations
12469 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12470 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12473 __Pyx_RefNannyFinishContext();
12477 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12478 PyObject *__pyx_r = NULL;
12479 __Pyx_TraceDeclarations
12480 __Pyx_RefNannyDeclarations
12481 PyObject *__pyx_t_1 = NULL;
12482 PyObject *__pyx_t_2 = NULL;
12483 PyObject *__pyx_t_3 = NULL;
12484 int __pyx_lineno = 0;
12485 const char *__pyx_filename = NULL;
12486 int __pyx_clineno = 0;
12487 __Pyx_RefNannySetupContext(
"__get__", 0);
12488 __Pyx_TraceCall(
"__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
12497 __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
12498 __Pyx_XDECREF(__pyx_r);
12499 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
12500 __Pyx_GOTREF(__pyx_t_1);
12501 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
12502 __Pyx_GOTREF(__pyx_t_2);
12503 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
12504 __Pyx_GOTREF(__pyx_t_3);
12505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12506 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12507 __pyx_r = __pyx_t_3;
12521 __Pyx_XDECREF(__pyx_t_1);
12522 __Pyx_XDECREF(__pyx_t_2);
12523 __Pyx_XDECREF(__pyx_t_3);
12524 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12527 __Pyx_XGIVEREF(__pyx_r);
12528 __Pyx_TraceReturn(__pyx_r, 0);
12529 __Pyx_RefNannyFinishContext();
12542 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
12543 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12544 PyObject *__pyx_r = 0;
12545 __Pyx_RefNannyDeclarations
12546 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12547 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12550 __Pyx_RefNannyFinishContext();
12554 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12555 PyObject *__pyx_v_result = NULL;
12556 PyObject *__pyx_v_length = NULL;
12557 PyObject *__pyx_r = NULL;
12558 __Pyx_TraceDeclarations
12559 __Pyx_RefNannyDeclarations
12562 Py_ssize_t *__pyx_t_3;
12563 Py_ssize_t *__pyx_t_4;
12564 Py_ssize_t *__pyx_t_5;
12565 PyObject *__pyx_t_6 = NULL;
12566 int __pyx_lineno = 0;
12567 const char *__pyx_filename = NULL;
12568 int __pyx_clineno = 0;
12569 __Pyx_RefNannySetupContext(
"__get__", 0);
12570 __Pyx_TraceCall(
"__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
12579 __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
12580 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12581 __pyx_t_2 = (__pyx_t_1 != 0);
12591 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
12592 __Pyx_INCREF(__pyx_int_1);
12593 __pyx_v_result = __pyx_int_1;
12602 __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
12603 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12604 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12605 __pyx_t_3 = __pyx_t_5;
12606 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
12607 __Pyx_GOTREF(__pyx_t_6);
12608 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12618 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
12619 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
12620 __Pyx_GOTREF(__pyx_t_6);
12621 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12632 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
12633 __Pyx_INCREF(__pyx_v_result);
12634 __Pyx_GIVEREF(__pyx_v_result);
12635 __Pyx_GOTREF(__pyx_v_self->_size);
12636 __Pyx_DECREF(__pyx_v_self->_size);
12637 __pyx_v_self->_size = __pyx_v_result;
12655 __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
12656 __Pyx_XDECREF(__pyx_r);
12657 __Pyx_INCREF(__pyx_v_self->_size);
12658 __pyx_r = __pyx_v_self->_size;
12671 __Pyx_XDECREF(__pyx_t_6);
12672 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12675 __Pyx_XDECREF(__pyx_v_result);
12676 __Pyx_XDECREF(__pyx_v_length);
12677 __Pyx_XGIVEREF(__pyx_r);
12678 __Pyx_TraceReturn(__pyx_r, 0);
12679 __Pyx_RefNannyFinishContext();
12692 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
12693 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12694 Py_ssize_t __pyx_r;
12695 __Pyx_RefNannyDeclarations
12696 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
12697 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12700 __Pyx_RefNannyFinishContext();
12704 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12705 Py_ssize_t __pyx_r;
12706 __Pyx_TraceDeclarations
12707 __Pyx_RefNannyDeclarations
12709 int __pyx_lineno = 0;
12710 const char *__pyx_filename = NULL;
12711 int __pyx_clineno = 0;
12712 __Pyx_RefNannySetupContext(
"__len__", 0);
12713 __Pyx_TraceCall(
"__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
12722 __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
12723 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
12733 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
12734 __pyx_r = (__pyx_v_self->view.shape[0]);
12753 __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
12767 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12770 __Pyx_TraceReturn(Py_None, 0);
12771 __Pyx_RefNannyFinishContext();
12784 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
12785 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12786 PyObject *__pyx_r = 0;
12787 __Pyx_RefNannyDeclarations
12788 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
12789 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12792 __Pyx_RefNannyFinishContext();
12796 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12797 PyObject *__pyx_r = NULL;
12798 __Pyx_TraceDeclarations
12799 __Pyx_RefNannyDeclarations
12800 PyObject *__pyx_t_1 = NULL;
12801 PyObject *__pyx_t_2 = NULL;
12802 PyObject *__pyx_t_3 = NULL;
12803 int __pyx_lineno = 0;
12804 const char *__pyx_filename = NULL;
12805 int __pyx_clineno = 0;
12806 __Pyx_RefNannySetupContext(
"__repr__", 0);
12807 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
12816 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
12817 __Pyx_XDECREF(__pyx_r);
12818 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
12819 __Pyx_GOTREF(__pyx_t_1);
12820 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
12821 __Pyx_GOTREF(__pyx_t_2);
12822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12823 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
12824 __Pyx_GOTREF(__pyx_t_1);
12825 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12834 __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
12835 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
12836 __Pyx_GOTREF(__pyx_t_2);
12845 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
12846 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
12847 __Pyx_GOTREF(__pyx_t_3);
12848 __Pyx_GIVEREF(__pyx_t_1);
12849 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
12850 __Pyx_GIVEREF(__pyx_t_2);
12851 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12854 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
12855 __Pyx_GOTREF(__pyx_t_2);
12856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12857 __pyx_r = __pyx_t_2;
12871 __Pyx_XDECREF(__pyx_t_1);
12872 __Pyx_XDECREF(__pyx_t_2);
12873 __Pyx_XDECREF(__pyx_t_3);
12874 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12877 __Pyx_XGIVEREF(__pyx_r);
12878 __Pyx_TraceReturn(__pyx_r, 0);
12879 __Pyx_RefNannyFinishContext();
12892 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
12893 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12894 PyObject *__pyx_r = 0;
12895 __Pyx_RefNannyDeclarations
12896 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
12897 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12900 __Pyx_RefNannyFinishContext();
12904 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12905 PyObject *__pyx_r = NULL;
12906 __Pyx_TraceDeclarations
12907 __Pyx_RefNannyDeclarations
12908 PyObject *__pyx_t_1 = NULL;
12909 PyObject *__pyx_t_2 = NULL;
12910 int __pyx_lineno = 0;
12911 const char *__pyx_filename = NULL;
12912 int __pyx_clineno = 0;
12913 __Pyx_RefNannySetupContext(
"__str__", 0);
12914 __Pyx_TraceCall(
"__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
12923 __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
12924 __Pyx_XDECREF(__pyx_r);
12925 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
12926 __Pyx_GOTREF(__pyx_t_1);
12927 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
12928 __Pyx_GOTREF(__pyx_t_2);
12929 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12930 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
12931 __Pyx_GOTREF(__pyx_t_1);
12932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12933 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
12934 __Pyx_GOTREF(__pyx_t_2);
12935 __Pyx_GIVEREF(__pyx_t_1);
12936 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12938 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
12939 __Pyx_GOTREF(__pyx_t_1);
12940 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12941 __pyx_r = __pyx_t_1;
12955 __Pyx_XDECREF(__pyx_t_1);
12956 __Pyx_XDECREF(__pyx_t_2);
12957 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12960 __Pyx_XGIVEREF(__pyx_r);
12961 __Pyx_TraceReturn(__pyx_r, 0);
12962 __Pyx_RefNannyFinishContext();
12975 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12976 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
12977 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12978 PyObject *__pyx_r = 0;
12979 __Pyx_RefNannyDeclarations
12980 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
12981 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12984 __Pyx_RefNannyFinishContext();
12988 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
12989 __Pyx_memviewslice *__pyx_v_mslice;
12990 __Pyx_memviewslice __pyx_v_tmp;
12991 PyObject *__pyx_r = NULL;
12992 __Pyx_TraceDeclarations
12993 __Pyx_RefNannyDeclarations
12994 __Pyx_memviewslice *__pyx_t_1;
12995 PyObject *__pyx_t_2 = NULL;
12996 int __pyx_lineno = 0;
12997 const char *__pyx_filename = NULL;
12998 int __pyx_clineno = 0;
12999 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
13000 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
13009 __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
13010 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
13011 __pyx_v_mslice = __pyx_t_1;
13020 __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
13021 __Pyx_XDECREF(__pyx_r);
13022 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
13023 __Pyx_GOTREF(__pyx_t_2);
13024 __pyx_r = __pyx_t_2;
13038 __Pyx_XDECREF(__pyx_t_2);
13039 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13042 __Pyx_XGIVEREF(__pyx_r);
13043 __Pyx_TraceReturn(__pyx_r, 0);
13044 __Pyx_RefNannyFinishContext();
13057 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13058 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13059 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13060 PyObject *__pyx_r = 0;
13061 __Pyx_RefNannyDeclarations
13062 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
13063 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13066 __Pyx_RefNannyFinishContext();
13070 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13071 __Pyx_memviewslice *__pyx_v_mslice;
13072 __Pyx_memviewslice __pyx_v_tmp;
13073 PyObject *__pyx_r = NULL;
13074 __Pyx_TraceDeclarations
13075 __Pyx_RefNannyDeclarations
13076 __Pyx_memviewslice *__pyx_t_1;
13077 PyObject *__pyx_t_2 = NULL;
13078 int __pyx_lineno = 0;
13079 const char *__pyx_filename = NULL;
13080 int __pyx_clineno = 0;
13081 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
13082 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
13091 __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
13092 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
13093 __pyx_v_mslice = __pyx_t_1;
13102 __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
13103 __Pyx_XDECREF(__pyx_r);
13104 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
13105 __Pyx_GOTREF(__pyx_t_2);
13106 __pyx_r = __pyx_t_2;
13120 __Pyx_XDECREF(__pyx_t_2);
13121 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13124 __Pyx_XGIVEREF(__pyx_r);
13125 __Pyx_TraceReturn(__pyx_r, 0);
13126 __Pyx_RefNannyFinishContext();
13139 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13140 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13141 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13142 PyObject *__pyx_r = 0;
13143 __Pyx_RefNannyDeclarations
13144 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
13145 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13148 __Pyx_RefNannyFinishContext();
13152 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
13153 __Pyx_memviewslice __pyx_v_mslice;
13155 PyObject *__pyx_r = NULL;
13156 __Pyx_TraceDeclarations
13157 __Pyx_RefNannyDeclarations
13158 __Pyx_memviewslice __pyx_t_1;
13159 PyObject *__pyx_t_2 = NULL;
13160 int __pyx_lineno = 0;
13161 const char *__pyx_filename = NULL;
13162 int __pyx_clineno = 0;
13163 __Pyx_RefNannySetupContext(
"copy", 0);
13164 __Pyx_TraceCall(
"copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
13173 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13174 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13183 __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
13184 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13193 __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
13194 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
13195 __pyx_v_mslice = __pyx_t_1;
13204 __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
13205 __Pyx_XDECREF(__pyx_r);
13206 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
13207 __Pyx_GOTREF(__pyx_t_2);
13208 __pyx_r = __pyx_t_2;
13222 __Pyx_XDECREF(__pyx_t_2);
13223 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13226 __Pyx_XGIVEREF(__pyx_r);
13227 __Pyx_TraceReturn(__pyx_r, 0);
13228 __Pyx_RefNannyFinishContext();
13241 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13242 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13243 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13244 PyObject *__pyx_r = 0;
13245 __Pyx_RefNannyDeclarations
13246 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
13247 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13250 __Pyx_RefNannyFinishContext();
13254 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
13255 __Pyx_memviewslice __pyx_v_src;
13256 __Pyx_memviewslice __pyx_v_dst;
13258 PyObject *__pyx_r = NULL;
13259 __Pyx_TraceDeclarations
13260 __Pyx_RefNannyDeclarations
13261 __Pyx_memviewslice __pyx_t_1;
13262 PyObject *__pyx_t_2 = NULL;
13263 int __pyx_lineno = 0;
13264 const char *__pyx_filename = NULL;
13265 int __pyx_clineno = 0;
13266 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
13267 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
13276 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13277 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13286 __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
13287 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13296 __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
13297 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
13298 __pyx_v_dst = __pyx_t_1;
13307 __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
13308 __Pyx_XDECREF(__pyx_r);
13309 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
13310 __Pyx_GOTREF(__pyx_t_2);
13311 __pyx_r = __pyx_t_2;
13325 __Pyx_XDECREF(__pyx_t_2);
13326 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13329 __Pyx_XGIVEREF(__pyx_r);
13330 __Pyx_TraceReturn(__pyx_r, 0);
13331 __Pyx_RefNannyFinishContext();
13342 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13343 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
13344 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13345 PyObject *__pyx_r = 0;
13346 __Pyx_RefNannyDeclarations
13347 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13348 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13351 __Pyx_RefNannyFinishContext();
13355 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
13356 PyObject *__pyx_r = NULL;
13357 __Pyx_TraceDeclarations
13358 __Pyx_RefNannyDeclarations
13359 PyObject *__pyx_t_1 = NULL;
13360 int __pyx_lineno = 0;
13361 const char *__pyx_filename = NULL;
13362 int __pyx_clineno = 0;
13363 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13364 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13372 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13373 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13374 __Pyx_GOTREF(__pyx_t_1);
13375 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13376 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13377 __PYX_ERR(1, 2, __pyx_L1_error)
13387 __Pyx_XDECREF(__pyx_t_1);
13388 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13390 __Pyx_XGIVEREF(__pyx_r);
13391 __Pyx_TraceReturn(__pyx_r, 0);
13392 __Pyx_RefNannyFinishContext();
13404 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13405 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
13406 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13407 PyObject *__pyx_r = 0;
13408 __Pyx_RefNannyDeclarations
13409 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13410 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13413 __Pyx_RefNannyFinishContext();
13417 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13418 PyObject *__pyx_r = NULL;
13419 __Pyx_TraceDeclarations
13420 __Pyx_RefNannyDeclarations
13421 PyObject *__pyx_t_1 = NULL;
13422 int __pyx_lineno = 0;
13423 const char *__pyx_filename = NULL;
13424 int __pyx_clineno = 0;
13425 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13426 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13433 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13434 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13435 __Pyx_GOTREF(__pyx_t_1);
13436 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13437 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13438 __PYX_ERR(1, 4, __pyx_L1_error)
13449 __Pyx_XDECREF(__pyx_t_1);
13450 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13452 __Pyx_XGIVEREF(__pyx_r);
13453 __Pyx_TraceReturn(__pyx_r, 0);
13454 __Pyx_RefNannyFinishContext();
13466 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13467 struct __pyx_memoryview_obj *__pyx_v_result = 0;
13468 PyObject *__pyx_r = NULL;
13469 __Pyx_TraceDeclarations
13470 __Pyx_RefNannyDeclarations
13471 PyObject *__pyx_t_1 = NULL;
13472 PyObject *__pyx_t_2 = NULL;
13473 PyObject *__pyx_t_3 = NULL;
13474 int __pyx_lineno = 0;
13475 const char *__pyx_filename = NULL;
13476 int __pyx_clineno = 0;
13477 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
13478 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
13487 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
13488 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
13489 __Pyx_GOTREF(__pyx_t_1);
13490 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
13491 __Pyx_GOTREF(__pyx_t_2);
13492 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
13493 __Pyx_GOTREF(__pyx_t_3);
13494 __Pyx_INCREF(__pyx_v_o);
13495 __Pyx_GIVEREF(__pyx_v_o);
13496 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13497 __Pyx_GIVEREF(__pyx_t_1);
13498 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13499 __Pyx_GIVEREF(__pyx_t_2);
13500 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13503 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
13504 __Pyx_GOTREF(__pyx_t_2);
13505 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13506 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
13516 __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
13517 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13526 __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
13527 __Pyx_XDECREF(__pyx_r);
13528 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13529 __pyx_r = ((PyObject *)__pyx_v_result);
13542 __Pyx_XDECREF(__pyx_t_1);
13543 __Pyx_XDECREF(__pyx_t_2);
13544 __Pyx_XDECREF(__pyx_t_3);
13545 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13548 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13549 __Pyx_XGIVEREF(__pyx_r);
13550 __Pyx_TraceReturn(__pyx_r, 0);
13551 __Pyx_RefNannyFinishContext();
13563 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13565 __Pyx_TraceDeclarations
13566 __Pyx_RefNannyDeclarations
13568 int __pyx_lineno = 0;
13569 const char *__pyx_filename = NULL;
13570 int __pyx_clineno = 0;
13571 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
13572 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
13581 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
13582 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13583 __pyx_r = __pyx_t_1;
13596 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13599 __Pyx_TraceReturn(Py_None, 0);
13600 __Pyx_RefNannyFinishContext();
13612 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
13613 PyObject *__pyx_v_tup = NULL;
13614 PyObject *__pyx_v_result = NULL;
13615 int __pyx_v_have_slices;
13616 int __pyx_v_seen_ellipsis;
13617 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13618 PyObject *__pyx_v_item = NULL;
13619 Py_ssize_t __pyx_v_nslices;
13620 PyObject *__pyx_r = NULL;
13621 __Pyx_TraceDeclarations
13622 __Pyx_RefNannyDeclarations
13625 PyObject *__pyx_t_3 = NULL;
13626 PyObject *__pyx_t_4 = NULL;
13627 Py_ssize_t __pyx_t_5;
13628 PyObject *(*__pyx_t_6)(PyObject *);
13629 PyObject *__pyx_t_7 = NULL;
13630 Py_ssize_t __pyx_t_8;
13633 PyObject *__pyx_t_11 = NULL;
13634 int __pyx_lineno = 0;
13635 const char *__pyx_filename = NULL;
13636 int __pyx_clineno = 0;
13637 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
13638 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
13647 __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
13648 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13649 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13659 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
13660 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
13661 __Pyx_GOTREF(__pyx_t_3);
13662 __Pyx_INCREF(__pyx_v_index);
13663 __Pyx_GIVEREF(__pyx_v_index);
13664 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13665 __pyx_v_tup = __pyx_t_3;
13685 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
13687 __Pyx_INCREF(__pyx_v_index);
13688 __pyx_v_tup = __pyx_v_index;
13699 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
13700 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
13701 __Pyx_GOTREF(__pyx_t_3);
13702 __pyx_v_result = ((PyObject*)__pyx_t_3);
13712 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
13713 __pyx_v_have_slices = 0;
13722 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
13723 __pyx_v_seen_ellipsis = 0;
13732 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
13733 __Pyx_INCREF(__pyx_int_0);
13734 __pyx_t_3 = __pyx_int_0;
13735 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
13736 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
13739 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
13740 __Pyx_GOTREF(__pyx_t_4);
13741 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
13744 if (likely(!__pyx_t_6)) {
13745 if (likely(PyList_CheckExact(__pyx_t_4))) {
13746 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
13747 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13748 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
13750 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
13751 __Pyx_GOTREF(__pyx_t_7);
13754 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
13755 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13756 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
13758 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
13759 __Pyx_GOTREF(__pyx_t_7);
13763 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
13764 if (unlikely(!__pyx_t_7)) {
13765 PyObject* exc_type = PyErr_Occurred();
13767 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13768 else __PYX_ERR(1, 681, __pyx_L1_error)
13772 __Pyx_GOTREF(__pyx_t_7);
13774 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
13776 __Pyx_INCREF(__pyx_t_3);
13777 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
13778 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
13779 __Pyx_GOTREF(__pyx_t_7);
13780 __Pyx_DECREF(__pyx_t_3);
13781 __pyx_t_3 = __pyx_t_7;
13791 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
13792 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13793 __pyx_t_1 = (__pyx_t_2 != 0);
13803 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
13804 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
13814 __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
13815 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
13816 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
13817 __Pyx_GOTREF(__pyx_t_7);
13818 { Py_ssize_t __pyx_temp;
13819 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
13820 __Pyx_INCREF(__pyx_slice__32);
13821 __Pyx_GIVEREF(__pyx_slice__32);
13822 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
13825 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
13826 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13835 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
13836 __pyx_v_seen_ellipsis = 1;
13855 __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
13857 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
13868 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
13869 __pyx_v_have_slices = 1;
13888 __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
13890 __pyx_t_2 = PySlice_Check(__pyx_v_item);
13891 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
13894 __pyx_t_1 = __pyx_t_10;
13895 goto __pyx_L9_bool_binop_done;
13897 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
13898 __pyx_t_1 = __pyx_t_10;
13899 __pyx_L9_bool_binop_done:;
13900 if (unlikely(__pyx_t_1)) {
13909 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
13910 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
13911 __Pyx_GOTREF(__pyx_t_7);
13912 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
13913 __Pyx_GOTREF(__pyx_t_11);
13914 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13915 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
13916 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13917 __PYX_ERR(1, 691, __pyx_L1_error)
13935 __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
13936 __pyx_t_10 = (__pyx_v_have_slices != 0);
13939 __pyx_t_1 = __pyx_t_10;
13940 goto __pyx_L11_bool_binop_done;
13942 __pyx_t_10 = PySlice_Check(__pyx_v_item);
13943 __pyx_t_2 = (__pyx_t_10 != 0);
13944 __pyx_t_1 = __pyx_t_2;
13945 __pyx_L11_bool_binop_done:;
13946 __pyx_v_have_slices = __pyx_t_1;
13955 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
13956 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
13967 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
13969 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13970 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13979 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
13980 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
13981 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
13990 __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
13991 __pyx_t_1 = (__pyx_v_nslices != 0);
14001 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
14002 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
14003 __Pyx_GOTREF(__pyx_t_3);
14004 { Py_ssize_t __pyx_temp;
14005 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14006 __Pyx_INCREF(__pyx_slice__32);
14007 __Pyx_GIVEREF(__pyx_slice__32);
14008 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
14011 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
14012 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14030 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
14031 __Pyx_XDECREF(__pyx_r);
14032 if (!__pyx_v_have_slices) {
14034 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14035 __Pyx_GOTREF(__pyx_t_4);
14036 __pyx_t_3 = __pyx_t_4;
14038 goto __pyx_L14_bool_binop_done;
14040 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14041 __Pyx_GOTREF(__pyx_t_4);
14042 __pyx_t_3 = __pyx_t_4;
14044 __pyx_L14_bool_binop_done:;
14045 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14046 __Pyx_GOTREF(__pyx_t_4);
14047 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
14048 __Pyx_GOTREF(__pyx_t_11);
14049 __Pyx_GIVEREF(__pyx_t_3);
14050 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14051 __Pyx_GIVEREF(__pyx_t_4);
14052 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14055 __pyx_r = ((PyObject*)__pyx_t_11);
14069 __Pyx_XDECREF(__pyx_t_3);
14070 __Pyx_XDECREF(__pyx_t_4);
14071 __Pyx_XDECREF(__pyx_t_7);
14072 __Pyx_XDECREF(__pyx_t_11);
14073 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14076 __Pyx_XDECREF(__pyx_v_tup);
14077 __Pyx_XDECREF(__pyx_v_result);
14078 __Pyx_XDECREF(__pyx_v_idx);
14079 __Pyx_XDECREF(__pyx_v_item);
14080 __Pyx_XGIVEREF(__pyx_r);
14081 __Pyx_TraceReturn(__pyx_r, 0);
14082 __Pyx_RefNannyFinishContext();
14094 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
14095 Py_ssize_t __pyx_v_suboffset;
14096 PyObject *__pyx_r = NULL;
14097 __Pyx_TraceDeclarations
14098 __Pyx_RefNannyDeclarations
14099 Py_ssize_t *__pyx_t_1;
14100 Py_ssize_t *__pyx_t_2;
14101 Py_ssize_t *__pyx_t_3;
14103 PyObject *__pyx_t_5 = NULL;
14104 int __pyx_lineno = 0;
14105 const char *__pyx_filename = NULL;
14106 int __pyx_clineno = 0;
14107 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
14108 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
14117 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14118 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14119 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14120 __pyx_t_1 = __pyx_t_3;
14121 __pyx_v_suboffset = (__pyx_t_1[0]);
14130 __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
14131 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14132 if (unlikely(__pyx_t_4)) {
14141 __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
14142 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
14143 __Pyx_GOTREF(__pyx_t_5);
14144 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14145 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14146 __PYX_ERR(1, 705, __pyx_L1_error)
14167 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14170 __Pyx_XDECREF(__pyx_t_5);
14171 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14174 __Pyx_XGIVEREF(__pyx_r);
14175 __Pyx_TraceReturn(__pyx_r, 0);
14176 __Pyx_RefNannyFinishContext();
14188 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14189 int __pyx_v_new_ndim;
14190 int __pyx_v_suboffset_dim;
14192 __Pyx_memviewslice __pyx_v_src;
14193 __Pyx_memviewslice __pyx_v_dst;
14194 __Pyx_memviewslice *__pyx_v_p_src;
14195 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14196 __Pyx_memviewslice *__pyx_v_p_dst;
14197 int *__pyx_v_p_suboffset_dim;
14198 Py_ssize_t __pyx_v_start;
14199 Py_ssize_t __pyx_v_stop;
14200 Py_ssize_t __pyx_v_step;
14201 int __pyx_v_have_start;
14202 int __pyx_v_have_stop;
14203 int __pyx_v_have_step;
14204 PyObject *__pyx_v_index = NULL;
14205 struct __pyx_memoryview_obj *__pyx_r = NULL;
14206 __Pyx_TraceDeclarations
14207 __Pyx_RefNannyDeclarations
14210 PyObject *__pyx_t_3 = NULL;
14211 struct __pyx_memoryview_obj *__pyx_t_4;
14214 Py_ssize_t __pyx_t_7;
14215 PyObject *(*__pyx_t_8)(PyObject *);
14216 PyObject *__pyx_t_9 = NULL;
14217 Py_ssize_t __pyx_t_10;
14219 Py_ssize_t __pyx_t_12;
14220 int __pyx_lineno = 0;
14221 const char *__pyx_filename = NULL;
14222 int __pyx_clineno = 0;
14223 __Pyx_RefNannySetupContext(
"memview_slice", 0);
14224 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
14233 __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
14234 __pyx_v_new_ndim = 0;
14235 __pyx_v_suboffset_dim = -1;
14244 __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
14245 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
14254 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14255 #ifndef CYTHON_WITHOUT_ASSERTIONS
14256 if (unlikely(__pyx_assertions_enabled())) {
14257 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14258 PyErr_SetNone(PyExc_AssertionError);
14259 __PYX_ERR(1, 724, __pyx_L1_error)
14271 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14272 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14273 __pyx_t_2 = (__pyx_t_1 != 0);
14283 __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
14284 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
14285 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14286 __Pyx_INCREF(__pyx_t_3);
14287 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14297 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14298 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14317 __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
14319 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14328 __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
14329 __pyx_v_p_src = (&__pyx_v_src);
14340 __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
14341 __pyx_t_4 = __pyx_v_p_src->memview;
14342 __pyx_v_dst.memview = __pyx_t_4;
14351 __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
14352 __pyx_t_5 = __pyx_v_p_src->data;
14353 __pyx_v_dst.data = __pyx_t_5;
14362 __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
14363 __pyx_v_p_dst = (&__pyx_v_dst);
14372 __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
14373 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14382 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14384 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14385 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14388 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
14389 __Pyx_GOTREF(__pyx_t_3);
14390 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
14393 if (likely(!__pyx_t_8)) {
14394 if (likely(PyList_CheckExact(__pyx_t_3))) {
14395 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
14396 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14397 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
14399 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
14400 __Pyx_GOTREF(__pyx_t_9);
14403 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
14404 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14405 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
14407 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
14408 __Pyx_GOTREF(__pyx_t_9);
14412 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14413 if (unlikely(!__pyx_t_9)) {
14414 PyObject* exc_type = PyErr_Occurred();
14416 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14417 else __PYX_ERR(1, 748, __pyx_L1_error)
14421 __Pyx_GOTREF(__pyx_t_9);
14423 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14425 __pyx_v_dim = __pyx_t_6;
14426 __pyx_t_6 = (__pyx_t_6 + 1);
14435 __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
14436 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14446 __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
14447 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
14456 __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
14457 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
14476 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
14477 __pyx_t_2 = (__pyx_v_index == Py_None);
14478 __pyx_t_1 = (__pyx_t_2 != 0);
14488 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
14489 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14498 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
14499 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14508 __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
14509 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14518 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
14519 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14538 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
14540 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
14541 __Pyx_GOTREF(__pyx_t_9);
14542 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
14544 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14546 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
14547 __pyx_t_10 = __pyx_t_12;
14548 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14549 goto __pyx_L7_bool_binop_done;
14552 __pyx_L7_bool_binop_done:;
14553 __pyx_v_start = __pyx_t_10;
14562 __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
14563 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
14564 __Pyx_GOTREF(__pyx_t_9);
14565 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
14567 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14569 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
14570 __pyx_t_10 = __pyx_t_12;
14571 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14572 goto __pyx_L9_bool_binop_done;
14575 __pyx_L9_bool_binop_done:;
14576 __pyx_v_stop = __pyx_t_10;
14585 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
14586 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
14587 __Pyx_GOTREF(__pyx_t_9);
14588 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
14590 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14592 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
14593 __pyx_t_10 = __pyx_t_12;
14594 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14595 goto __pyx_L11_bool_binop_done;
14598 __pyx_L11_bool_binop_done:;
14599 __pyx_v_step = __pyx_t_10;
14608 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
14609 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
14610 __Pyx_GOTREF(__pyx_t_9);
14611 __pyx_t_1 = (__pyx_t_9 != Py_None);
14612 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14613 __pyx_v_have_start = __pyx_t_1;
14622 __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
14623 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
14624 __Pyx_GOTREF(__pyx_t_9);
14625 __pyx_t_1 = (__pyx_t_9 != Py_None);
14626 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14627 __pyx_v_have_stop = __pyx_t_1;
14636 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
14637 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
14638 __Pyx_GOTREF(__pyx_t_9);
14639 __pyx_t_1 = (__pyx_t_9 != Py_None);
14640 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14641 __pyx_v_have_step = __pyx_t_1;
14650 __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
14651 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
14660 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
14661 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14672 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14674 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14683 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
14684 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14685 __pyx_t_2 = (__pyx_t_1 != 0);
14695 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
14696 __Pyx_XDECREF(((PyObject *)__pyx_r));
14705 __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
14706 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
14715 __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
14716 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
14725 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
14726 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
14727 __Pyx_GOTREF(__pyx_t_3);
14728 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
14729 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14749 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
14751 __Pyx_XDECREF(((PyObject *)__pyx_r));
14760 __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
14761 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
14762 __Pyx_GOTREF(__pyx_t_3);
14771 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
14772 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
14773 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14788 __Pyx_XDECREF(__pyx_t_3);
14789 __Pyx_XDECREF(__pyx_t_9);
14790 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14793 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14794 __Pyx_XDECREF(__pyx_v_index);
14795 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14796 __Pyx_TraceReturn(__pyx_r, 0);
14797 __Pyx_RefNannyFinishContext();
14809 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
14810 Py_ssize_t __pyx_v_new_shape;
14811 int __pyx_v_negative_step;
14813 __Pyx_TraceDeclarations
14817 int __pyx_lineno = 0;
14818 const char *__pyx_filename = NULL;
14819 int __pyx_clineno = 0;
14820 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
14829 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
14830 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
14840 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
14841 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
14851 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
14852 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14870 __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
14871 __pyx_t_1 = (0 <= __pyx_v_start);
14873 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14875 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14885 __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
14886 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
14914 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
14916 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
14919 __pyx_t_2 = __pyx_t_1;
14920 goto __pyx_L6_bool_binop_done;
14922 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
14923 __pyx_t_2 = __pyx_t_1;
14924 __pyx_L6_bool_binop_done:;
14925 __pyx_v_negative_step = __pyx_t_2;
14934 __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
14935 __pyx_t_1 = (__pyx_v_have_step != 0);
14938 __pyx_t_2 = __pyx_t_1;
14939 goto __pyx_L9_bool_binop_done;
14941 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
14942 __pyx_t_2 = __pyx_t_1;
14943 __pyx_L9_bool_binop_done:;
14953 __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
14954 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
14972 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
14973 __pyx_t_2 = (__pyx_v_have_start != 0);
14983 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
14984 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14994 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
14995 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15004 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
15005 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15015 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
15044 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
15045 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15055 __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
15056 __pyx_t_2 = (__pyx_v_negative_step != 0);
15066 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
15067 __pyx_v_start = (__pyx_v_shape - 1);
15086 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
15088 __pyx_v_start = __pyx_v_shape;
15119 __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
15121 __pyx_t_2 = (__pyx_v_negative_step != 0);
15131 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15132 __pyx_v_start = (__pyx_v_shape - 1);
15151 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15166 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15167 __pyx_t_2 = (__pyx_v_have_stop != 0);
15177 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15178 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15188 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15189 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15198 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15199 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15209 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15238 __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
15239 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15249 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15250 __pyx_v_stop = __pyx_v_shape;
15279 __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
15281 __pyx_t_2 = (__pyx_v_negative_step != 0);
15291 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15292 __pyx_v_stop = -1L;
15311 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
15313 __pyx_v_stop = __pyx_v_shape;
15326 __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
15327 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15337 __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
15356 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15365 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15375 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15393 __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
15394 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15404 __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
15405 __pyx_v_new_shape = 0;
15423 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
15424 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15433 __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
15434 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15443 __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
15444 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15455 __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
15456 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15466 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
15467 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15486 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
15488 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15489 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15500 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
15501 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15511 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
15512 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15522 __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
15523 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15533 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
15534 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15553 __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
15563 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
15564 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
15585 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
15587 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15607 __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
15623 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15625 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15627 __Pyx_PyGILState_Release(__pyx_gilstate_save);
15632 __Pyx_TraceReturn(Py_None, 1);
15644 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
15645 Py_ssize_t __pyx_v_shape;
15646 Py_ssize_t __pyx_v_stride;
15647 Py_ssize_t __pyx_v_suboffset;
15648 Py_ssize_t __pyx_v_itemsize;
15649 char *__pyx_v_resultp;
15651 __Pyx_TraceDeclarations
15652 __Pyx_RefNannyDeclarations
15653 Py_ssize_t __pyx_t_1;
15655 PyObject *__pyx_t_3 = NULL;
15656 PyObject *__pyx_t_4 = NULL;
15657 int __pyx_lineno = 0;
15658 const char *__pyx_filename = NULL;
15659 int __pyx_clineno = 0;
15660 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
15661 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
15670 __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
15671 __pyx_v_suboffset = -1L;
15680 __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
15681 __pyx_t_1 = __pyx_v_view->itemsize;
15682 __pyx_v_itemsize = __pyx_t_1;
15691 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
15692 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
15702 __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
15703 if (unlikely(__pyx_v_itemsize == 0)) {
15704 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
15705 __PYX_ERR(1, 919, __pyx_L1_error)
15707 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
15708 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
15709 __PYX_ERR(1, 919, __pyx_L1_error)
15711 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
15720 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
15721 __pyx_v_stride = __pyx_v_itemsize;
15740 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
15742 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15751 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
15752 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15761 __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
15762 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
15772 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
15773 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15793 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
15794 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15804 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
15805 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15814 __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
15815 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15816 if (unlikely(__pyx_t_2)) {
15825 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
15826 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
15827 __Pyx_GOTREF(__pyx_t_3);
15828 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
15829 __Pyx_GOTREF(__pyx_t_4);
15830 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15831 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
15832 __Pyx_GOTREF(__pyx_t_3);
15833 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15834 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15835 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15836 __PYX_ERR(1, 930, __pyx_L1_error)
15863 __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
15864 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
15865 if (unlikely(__pyx_t_2)) {
15874 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
15875 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
15876 __Pyx_GOTREF(__pyx_t_3);
15877 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
15878 __Pyx_GOTREF(__pyx_t_4);
15879 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15880 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
15881 __Pyx_GOTREF(__pyx_t_3);
15882 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15883 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15884 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15885 __PYX_ERR(1, 933, __pyx_L1_error)
15903 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
15904 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15913 __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
15914 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15924 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
15925 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15943 __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
15944 __pyx_r = __pyx_v_resultp;
15957 __Pyx_XDECREF(__pyx_t_3);
15958 __Pyx_XDECREF(__pyx_t_4);
15959 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15962 __Pyx_TraceReturn(Py_None, 0);
15963 __Pyx_RefNannyFinishContext();
15975 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15977 Py_ssize_t *__pyx_v_shape;
15978 Py_ssize_t *__pyx_v_strides;
15982 __Pyx_TraceDeclarations
15984 Py_ssize_t *__pyx_t_2;
15987 Py_ssize_t __pyx_t_5;
15988 Py_ssize_t __pyx_t_6;
15992 int __pyx_lineno = 0;
15993 const char *__pyx_filename = NULL;
15994 int __pyx_clineno = 0;
15995 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
16004 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
16005 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16006 __pyx_v_ndim = __pyx_t_1;
16015 __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
16016 __pyx_t_2 = __pyx_v_memslice->shape;
16017 __pyx_v_shape = __pyx_t_2;
16026 __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
16027 __pyx_t_2 = __pyx_v_memslice->strides;
16028 __pyx_v_strides = __pyx_t_2;
16037 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
16038 __pyx_t_3 = (__pyx_v_ndim / 2);
16039 __pyx_t_4 = __pyx_t_3;
16040 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16041 __pyx_v_i = __pyx_t_1;
16050 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
16051 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16060 __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
16061 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16062 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16063 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16064 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16073 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
16074 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16075 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16076 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16077 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16086 __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
16087 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16090 __pyx_t_7 = __pyx_t_8;
16091 goto __pyx_L6_bool_binop_done;
16093 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16094 __pyx_t_7 = __pyx_t_8;
16095 __pyx_L6_bool_binop_done:;
16105 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16106 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
16125 __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
16141 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16143 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16145 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16150 __Pyx_TraceReturn(Py_None, 1);
16163 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16164 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16165 __Pyx_RefNannyDeclarations
16166 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16167 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16170 __Pyx_RefNannyFinishContext();
16173 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16174 __Pyx_TraceDeclarations
16175 __Pyx_RefNannyDeclarations
16176 int __pyx_lineno = 0;
16177 const char *__pyx_filename = NULL;
16178 int __pyx_clineno = 0;
16179 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
16180 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
16189 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
16190 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16203 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16205 __Pyx_TraceReturn(Py_None, 0);
16206 __Pyx_RefNannyFinishContext();
16217 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16218 PyObject *__pyx_r = NULL;
16219 __Pyx_TraceDeclarations
16220 __Pyx_RefNannyDeclarations
16222 PyObject *__pyx_t_2 = NULL;
16223 int __pyx_lineno = 0;
16224 const char *__pyx_filename = NULL;
16225 int __pyx_clineno = 0;
16226 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16227 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
16236 __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
16237 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16247 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16248 __Pyx_XDECREF(__pyx_r);
16249 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16250 __Pyx_GOTREF(__pyx_t_2);
16251 __pyx_r = __pyx_t_2;
16271 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
16273 __Pyx_XDECREF(__pyx_r);
16274 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
16275 __Pyx_GOTREF(__pyx_t_2);
16276 __pyx_r = __pyx_t_2;
16291 __Pyx_XDECREF(__pyx_t_2);
16292 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16295 __Pyx_XGIVEREF(__pyx_r);
16296 __Pyx_TraceReturn(__pyx_r, 0);
16297 __Pyx_RefNannyFinishContext();
16309 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16310 PyObject *__pyx_r = NULL;
16311 __Pyx_TraceDeclarations
16312 __Pyx_RefNannyDeclarations
16315 PyObject *__pyx_t_3 = NULL;
16316 int __pyx_lineno = 0;
16317 const char *__pyx_filename = NULL;
16318 int __pyx_clineno = 0;
16319 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16320 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
16329 __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
16330 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16340 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
16341 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
16360 __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
16362 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
16363 __Pyx_GOTREF(__pyx_t_3);
16364 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16377 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16380 __Pyx_XDECREF(__pyx_t_3);
16381 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16384 __Pyx_XGIVEREF(__pyx_r);
16385 __Pyx_TraceReturn(__pyx_r, 0);
16386 __Pyx_RefNannyFinishContext();
16399 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
16400 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16401 PyObject *__pyx_r = 0;
16402 __Pyx_RefNannyDeclarations
16403 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16404 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16407 __Pyx_RefNannyFinishContext();
16411 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16412 PyObject *__pyx_r = NULL;
16413 __Pyx_TraceDeclarations
16414 __Pyx_RefNannyDeclarations
16415 int __pyx_lineno = 0;
16416 const char *__pyx_filename = NULL;
16417 int __pyx_clineno = 0;
16418 __Pyx_RefNannySetupContext(
"__get__", 0);
16419 __Pyx_TraceCall(
"__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
16428 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
16429 __Pyx_XDECREF(__pyx_r);
16430 __Pyx_INCREF(__pyx_v_self->from_object);
16431 __pyx_r = __pyx_v_self->from_object;
16444 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16447 __Pyx_XGIVEREF(__pyx_r);
16448 __Pyx_TraceReturn(__pyx_r, 0);
16449 __Pyx_RefNannyFinishContext();
16460 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16461 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
16462 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16463 PyObject *__pyx_r = 0;
16464 __Pyx_RefNannyDeclarations
16465 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
16466 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16469 __Pyx_RefNannyFinishContext();
16473 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16474 PyObject *__pyx_r = NULL;
16475 __Pyx_TraceDeclarations
16476 __Pyx_RefNannyDeclarations
16477 PyObject *__pyx_t_1 = NULL;
16478 int __pyx_lineno = 0;
16479 const char *__pyx_filename = NULL;
16480 int __pyx_clineno = 0;
16481 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
16482 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
16490 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
16491 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16492 __Pyx_GOTREF(__pyx_t_1);
16493 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16494 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16495 __PYX_ERR(1, 2, __pyx_L1_error)
16505 __Pyx_XDECREF(__pyx_t_1);
16506 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16508 __Pyx_XGIVEREF(__pyx_r);
16509 __Pyx_TraceReturn(__pyx_r, 0);
16510 __Pyx_RefNannyFinishContext();
16522 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
16523 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
16524 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16525 PyObject *__pyx_r = 0;
16526 __Pyx_RefNannyDeclarations
16527 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
16528 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16531 __Pyx_RefNannyFinishContext();
16535 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16536 PyObject *__pyx_r = NULL;
16537 __Pyx_TraceDeclarations
16538 __Pyx_RefNannyDeclarations
16539 PyObject *__pyx_t_1 = NULL;
16540 int __pyx_lineno = 0;
16541 const char *__pyx_filename = NULL;
16542 int __pyx_clineno = 0;
16543 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
16544 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
16551 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
16552 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16553 __Pyx_GOTREF(__pyx_t_1);
16554 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16555 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16556 __PYX_ERR(1, 4, __pyx_L1_error)
16567 __Pyx_XDECREF(__pyx_t_1);
16568 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16570 __Pyx_XGIVEREF(__pyx_r);
16571 __Pyx_TraceReturn(__pyx_r, 0);
16572 __Pyx_RefNannyFinishContext();
16584 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
16585 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16586 Py_ssize_t __pyx_v_suboffset;
16587 PyObject *__pyx_v_length = NULL;
16588 PyObject *__pyx_r = NULL;
16589 __Pyx_TraceDeclarations
16590 __Pyx_RefNannyDeclarations
16592 PyObject *__pyx_t_2 = NULL;
16593 PyObject *__pyx_t_3 = NULL;
16594 __Pyx_TypeInfo *__pyx_t_4;
16595 Py_buffer __pyx_t_5;
16596 Py_ssize_t *__pyx_t_6;
16597 Py_ssize_t *__pyx_t_7;
16598 Py_ssize_t *__pyx_t_8;
16599 Py_ssize_t __pyx_t_9;
16600 int __pyx_lineno = 0;
16601 const char *__pyx_filename = NULL;
16602 int __pyx_clineno = 0;
16603 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
16604 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
16613 __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
16614 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16624 __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
16625 __Pyx_XDECREF(__pyx_r);
16626 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16645 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
16646 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
16647 __Pyx_GOTREF(__pyx_t_2);
16648 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
16649 __Pyx_GOTREF(__pyx_t_3);
16650 __Pyx_INCREF(Py_None);
16651 __Pyx_GIVEREF(Py_None);
16652 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
16653 __Pyx_INCREF(__pyx_int_0);
16654 __Pyx_GIVEREF(__pyx_int_0);
16655 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
16656 __Pyx_GIVEREF(__pyx_t_2);
16657 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16659 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
16660 __Pyx_GOTREF(__pyx_t_2);
16661 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16662 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16672 __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
16673 __pyx_v_result->from_slice = __pyx_v_memviewslice;
16682 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
16683 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16692 __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
16693 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
16694 __Pyx_GOTREF(__pyx_t_2);
16695 __Pyx_GIVEREF(__pyx_t_2);
16696 __Pyx_GOTREF(__pyx_v_result->from_object);
16697 __Pyx_DECREF(__pyx_v_result->from_object);
16698 __pyx_v_result->from_object = __pyx_t_2;
16708 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
16709 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16710 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16719 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
16720 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16721 __pyx_v_result->__pyx_base.view = __pyx_t_5;
16730 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
16731 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
16740 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
16741 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16750 __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
16751 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16760 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
16761 Py_INCREF(Py_None);
16770 __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
16771 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16781 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
16782 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16801 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
16803 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16814 __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
16815 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16824 __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
16825 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16834 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
16835 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16844 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
16845 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16846 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16847 __pyx_t_6 = __pyx_t_8;
16848 __pyx_v_suboffset = (__pyx_t_6[0]);
16857 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
16858 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16868 __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
16869 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16878 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
16879 goto __pyx_L6_break;
16899 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
16900 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16901 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16910 __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
16911 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16912 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16913 __pyx_t_6 = __pyx_t_8;
16914 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
16915 __Pyx_GOTREF(__pyx_t_2);
16916 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16926 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
16927 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
16928 __Pyx_GOTREF(__pyx_t_2);
16929 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
16930 __Pyx_GOTREF(__pyx_t_3);
16931 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16932 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
16933 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16934 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16944 __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
16945 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16954 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
16955 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16964 __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
16965 __Pyx_XDECREF(__pyx_r);
16966 __Pyx_INCREF(((PyObject *)__pyx_v_result));
16967 __pyx_r = ((PyObject *)__pyx_v_result);
16980 __Pyx_XDECREF(__pyx_t_2);
16981 __Pyx_XDECREF(__pyx_t_3);
16982 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16985 __Pyx_XDECREF((PyObject *)__pyx_v_result);
16986 __Pyx_XDECREF(__pyx_v_length);
16987 __Pyx_XGIVEREF(__pyx_r);
16988 __Pyx_TraceReturn(__pyx_r, 0);
16989 __Pyx_RefNannyFinishContext();
17001 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17002 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17003 __Pyx_memviewslice *__pyx_r;
17004 __Pyx_TraceDeclarations
17005 __Pyx_RefNannyDeclarations
17008 PyObject *__pyx_t_3 = NULL;
17009 int __pyx_lineno = 0;
17010 const char *__pyx_filename = NULL;
17011 int __pyx_clineno = 0;
17012 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17013 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
17022 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
17023 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17024 __pyx_t_2 = (__pyx_t_1 != 0);
17034 __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
17035 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
17036 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17037 __Pyx_INCREF(__pyx_t_3);
17038 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17048 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
17049 __pyx_r = (&__pyx_v_obj->from_slice);
17068 __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
17070 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17079 __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
17080 __pyx_r = __pyx_v_mslice;
17094 __Pyx_XDECREF(__pyx_t_3);
17095 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17098 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17099 __Pyx_TraceReturn(Py_None, 0);
17100 __Pyx_RefNannyFinishContext();
17112 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17114 Py_ssize_t *__pyx_v_shape;
17115 Py_ssize_t *__pyx_v_strides;
17116 Py_ssize_t *__pyx_v_suboffsets;
17117 __Pyx_TraceDeclarations
17118 __Pyx_RefNannyDeclarations
17119 Py_ssize_t *__pyx_t_1;
17123 Py_ssize_t __pyx_t_5;
17124 int __pyx_lineno = 0;
17125 const char *__pyx_filename = NULL;
17126 int __pyx_clineno = 0;
17127 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17128 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
17137 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17138 __pyx_t_1 = __pyx_v_memview->view.shape;
17139 __pyx_v_shape = __pyx_t_1;
17148 __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
17149 __pyx_t_1 = __pyx_v_memview->view.strides;
17150 __pyx_v_strides = __pyx_t_1;
17159 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17160 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17161 __pyx_v_suboffsets = __pyx_t_1;
17170 __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
17171 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17180 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17181 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17190 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17191 __pyx_t_2 = __pyx_v_memview->view.ndim;
17192 __pyx_t_3 = __pyx_t_2;
17193 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17194 __pyx_v_dim = __pyx_t_4;
17203 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17204 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17213 __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
17214 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17223 __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
17224 if ((__pyx_v_suboffsets != 0)) {
17225 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17229 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17243 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17245 __Pyx_TraceReturn(Py_None, 0);
17246 __Pyx_RefNannyFinishContext();
17257 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
17258 __Pyx_memviewslice __pyx_v_memviewslice;
17259 PyObject *__pyx_r = NULL;
17260 __Pyx_TraceDeclarations
17261 __Pyx_RefNannyDeclarations
17262 PyObject *__pyx_t_1 = NULL;
17263 int __pyx_lineno = 0;
17264 const char *__pyx_filename = NULL;
17265 int __pyx_clineno = 0;
17266 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
17267 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
17276 __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
17277 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17286 __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
17287 __Pyx_XDECREF(__pyx_r);
17288 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
17289 __Pyx_GOTREF(__pyx_t_1);
17290 __pyx_r = __pyx_t_1;
17304 __Pyx_XDECREF(__pyx_t_1);
17305 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17308 __Pyx_XGIVEREF(__pyx_r);
17309 __Pyx_TraceReturn(__pyx_r, 0);
17310 __Pyx_RefNannyFinishContext();
17322 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17323 PyObject *(*__pyx_v_to_object_func)(
char *);
17324 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
17325 PyObject *__pyx_r = NULL;
17326 __Pyx_TraceDeclarations
17327 __Pyx_RefNannyDeclarations
17330 PyObject *(*__pyx_t_3)(
char *);
17331 int (*__pyx_t_4)(
char *, PyObject *);
17332 PyObject *__pyx_t_5 = NULL;
17333 int __pyx_lineno = 0;
17334 const char *__pyx_filename = NULL;
17335 int __pyx_clineno = 0;
17336 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
17337 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
17346 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
17347 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17348 __pyx_t_2 = (__pyx_t_1 != 0);
17358 __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
17359 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17360 __pyx_v_to_object_func = __pyx_t_3;
17369 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
17370 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17371 __pyx_v_to_dtype_func = __pyx_t_4;
17390 __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
17392 __pyx_v_to_object_func = NULL;
17401 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
17402 __pyx_v_to_dtype_func = NULL;
17413 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
17414 __Pyx_XDECREF(__pyx_r);
17423 __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
17424 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
17425 __Pyx_GOTREF(__pyx_t_5);
17426 __pyx_r = __pyx_t_5;
17440 __Pyx_XDECREF(__pyx_t_5);
17441 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17444 __Pyx_XGIVEREF(__pyx_r);
17445 __Pyx_TraceReturn(__pyx_r, 0);
17446 __Pyx_RefNannyFinishContext();
17458 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17459 Py_ssize_t __pyx_r;
17460 __Pyx_TraceDeclarations
17462 int __pyx_lineno = 0;
17463 const char *__pyx_filename = NULL;
17464 int __pyx_clineno = 0;
17465 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
17474 __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
17475 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17485 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
17486 __pyx_r = (-__pyx_v_arg);
17505 __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
17507 __pyx_r = __pyx_v_arg;
17521 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17524 __Pyx_TraceReturn(Py_None, 1);
17536 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
17538 Py_ssize_t __pyx_v_c_stride;
17539 Py_ssize_t __pyx_v_f_stride;
17541 __Pyx_TraceDeclarations
17546 int __pyx_lineno = 0;
17547 const char *__pyx_filename = NULL;
17548 int __pyx_clineno = 0;
17549 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
17558 __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
17559 __pyx_v_c_stride = 0;
17568 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
17569 __pyx_v_f_stride = 0;
17578 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
17579 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17580 __pyx_v_i = __pyx_t_1;
17589 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
17590 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17600 __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
17601 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17610 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
17611 goto __pyx_L4_break;
17631 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
17632 __pyx_t_1 = __pyx_v_ndim;
17633 __pyx_t_3 = __pyx_t_1;
17634 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17635 __pyx_v_i = __pyx_t_4;
17644 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
17645 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17655 __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
17656 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17665 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
17666 goto __pyx_L7_break;
17686 __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
17687 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17697 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
17717 __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
17733 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17736 __Pyx_TraceReturn(Py_None, 1);
17748 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
17749 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17750 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
17751 Py_ssize_t __pyx_v_dst_extent;
17752 Py_ssize_t __pyx_v_src_stride;
17753 Py_ssize_t __pyx_v_dst_stride;
17757 Py_ssize_t __pyx_t_4;
17758 Py_ssize_t __pyx_t_5;
17759 Py_ssize_t __pyx_t_6;
17768 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17777 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17786 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17795 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17804 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17814 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
17817 __pyx_t_1 = __pyx_t_2;
17818 goto __pyx_L5_bool_binop_done;
17820 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
17823 __pyx_t_1 = __pyx_t_2;
17824 goto __pyx_L5_bool_binop_done;
17834 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17836 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17838 __pyx_t_3 = (__pyx_t_2 != 0);
17839 __pyx_t_1 = __pyx_t_3;
17840 __pyx_L5_bool_binop_done:;
17858 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17878 __pyx_t_4 = __pyx_v_dst_extent;
17879 __pyx_t_5 = __pyx_t_4;
17880 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17881 __pyx_v_i = __pyx_t_6;
17890 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17899 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17908 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17931 __pyx_t_4 = __pyx_v_dst_extent;
17932 __pyx_t_5 = __pyx_t_4;
17933 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17934 __pyx_v_i = __pyx_t_6;
17943 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17952 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17961 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17985 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
17986 __Pyx_TraceDeclarations
17987 int __pyx_lineno = 0;
17988 const char *__pyx_filename = NULL;
17989 int __pyx_clineno = 0;
17990 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
17999 __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
18000 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18013 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18015 __Pyx_TraceReturn(Py_None, 1);
18026 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18027 Py_ssize_t __pyx_v_shape;
18028 Py_ssize_t __pyx_v_size;
18029 Py_ssize_t __pyx_r;
18030 __Pyx_TraceDeclarations
18031 Py_ssize_t __pyx_t_1;
18032 Py_ssize_t *__pyx_t_2;
18033 Py_ssize_t *__pyx_t_3;
18034 Py_ssize_t *__pyx_t_4;
18035 int __pyx_lineno = 0;
18036 const char *__pyx_filename = NULL;
18037 int __pyx_clineno = 0;
18038 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
18047 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
18048 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18049 __pyx_v_size = __pyx_t_1;
18058 __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
18059 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18060 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18061 __pyx_t_2 = __pyx_t_4;
18062 __pyx_v_shape = (__pyx_t_2[0]);
18071 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
18072 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18082 __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
18083 __pyx_r = __pyx_v_size;
18096 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18099 __Pyx_TraceReturn(Py_None, 1);
18111 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18113 Py_ssize_t __pyx_r;
18114 __Pyx_TraceDeclarations
18119 int __pyx_lineno = 0;
18120 const char *__pyx_filename = NULL;
18121 int __pyx_clineno = 0;
18122 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
18131 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18132 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18142 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18143 __pyx_t_2 = __pyx_v_ndim;
18144 __pyx_t_3 = __pyx_t_2;
18145 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18146 __pyx_v_idx = __pyx_t_4;
18155 __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
18156 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18165 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18166 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18186 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18188 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18189 __pyx_v_idx = __pyx_t_2;
18198 __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
18199 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18208 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18209 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18221 __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
18222 __pyx_r = __pyx_v_stride;
18235 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18238 __Pyx_TraceReturn(Py_None, 1);
18250 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18252 void *__pyx_v_result;
18253 size_t __pyx_v_itemsize;
18254 size_t __pyx_v_size;
18256 __Pyx_TraceDeclarations
18257 Py_ssize_t __pyx_t_1;
18260 struct __pyx_memoryview_obj *__pyx_t_4;
18263 int __pyx_lineno = 0;
18264 const char *__pyx_filename = NULL;
18265 int __pyx_clineno = 0;
18266 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
18275 __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
18276 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18277 __pyx_v_itemsize = __pyx_t_1;
18286 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18287 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18296 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18297 __pyx_v_result = malloc(__pyx_v_size);
18306 __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
18307 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18317 __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
18318 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
18336 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
18337 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
18346 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
18347 __pyx_t_4 = __pyx_v_src->memview;
18348 __pyx_v_tmpslice->memview = __pyx_t_4;
18357 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
18358 __pyx_t_3 = __pyx_v_ndim;
18359 __pyx_t_5 = __pyx_t_3;
18360 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18361 __pyx_v_i = __pyx_t_6;
18370 __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
18371 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18380 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
18381 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18391 __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
18392 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18401 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
18402 __pyx_t_3 = __pyx_v_ndim;
18403 __pyx_t_5 = __pyx_t_3;
18404 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18405 __pyx_v_i = __pyx_t_6;
18414 __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
18415 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18425 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
18426 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18445 __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
18446 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18456 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
18457 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18476 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
18478 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18489 __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
18490 __pyx_r = __pyx_v_result;
18505 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18507 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18509 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18514 __Pyx_TraceReturn(Py_None, 1);
18526 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18528 __Pyx_TraceDeclarations
18529 __Pyx_RefNannyDeclarations
18530 PyObject *__pyx_t_1 = NULL;
18531 PyObject *__pyx_t_2 = NULL;
18532 PyObject *__pyx_t_3 = NULL;
18533 PyObject *__pyx_t_4 = NULL;
18534 int __pyx_lineno = 0;
18535 const char *__pyx_filename = NULL;
18536 int __pyx_clineno = 0;
18538 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18540 __Pyx_RefNannySetupContext(
"_err_extents", 0);
18541 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
18550 __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
18551 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
18552 __Pyx_GOTREF(__pyx_t_1);
18553 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
18554 __Pyx_GOTREF(__pyx_t_2);
18555 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
18556 __Pyx_GOTREF(__pyx_t_3);
18557 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
18558 __Pyx_GOTREF(__pyx_t_4);
18559 __Pyx_GIVEREF(__pyx_t_1);
18560 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18561 __Pyx_GIVEREF(__pyx_t_2);
18562 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18563 __Pyx_GIVEREF(__pyx_t_3);
18564 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18576 __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
18577 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
18578 __Pyx_GOTREF(__pyx_t_3);
18579 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18580 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
18581 __Pyx_GOTREF(__pyx_t_4);
18582 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18583 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18584 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18585 __PYX_ERR(1, 1255, __pyx_L1_error)
18597 __Pyx_XDECREF(__pyx_t_1);
18598 __Pyx_XDECREF(__pyx_t_2);
18599 __Pyx_XDECREF(__pyx_t_3);
18600 __Pyx_XDECREF(__pyx_t_4);
18601 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18603 __Pyx_TraceReturn(Py_None, 0);
18604 __Pyx_RefNannyFinishContext();
18606 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18619 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
18621 __Pyx_TraceDeclarations
18622 __Pyx_RefNannyDeclarations
18623 PyObject *__pyx_t_1 = NULL;
18624 PyObject *__pyx_t_2 = NULL;
18625 PyObject *__pyx_t_3 = NULL;
18626 PyObject *__pyx_t_4 = NULL;
18627 int __pyx_lineno = 0;
18628 const char *__pyx_filename = NULL;
18629 int __pyx_clineno = 0;
18631 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18633 __Pyx_RefNannySetupContext(
"_err_dim", 0);
18634 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
18635 __Pyx_INCREF(__pyx_v_error);
18644 __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
18645 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
18646 __Pyx_GOTREF(__pyx_t_2);
18647 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
18648 __Pyx_GOTREF(__pyx_t_3);
18649 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
18650 __Pyx_GOTREF(__pyx_t_4);
18651 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18652 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18653 __Pyx_INCREF(__pyx_v_error);
18654 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18655 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18656 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18657 if (likely(__pyx_t_2)) {
18658 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
18659 __Pyx_INCREF(__pyx_t_2);
18660 __Pyx_INCREF(
function);
18661 __Pyx_DECREF_SET(__pyx_t_3,
function);
18664 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
18665 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18667 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
18668 __Pyx_GOTREF(__pyx_t_1);
18669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18670 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18672 __PYX_ERR(1, 1260, __pyx_L1_error)
18684 __Pyx_XDECREF(__pyx_t_1);
18685 __Pyx_XDECREF(__pyx_t_2);
18686 __Pyx_XDECREF(__pyx_t_3);
18687 __Pyx_XDECREF(__pyx_t_4);
18688 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18690 __Pyx_XDECREF(__pyx_v_error);
18691 __Pyx_TraceReturn(Py_None, 0);
18692 __Pyx_RefNannyFinishContext();
18694 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18707 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
18709 __Pyx_TraceDeclarations
18710 __Pyx_RefNannyDeclarations
18712 PyObject *__pyx_t_2 = NULL;
18713 PyObject *__pyx_t_3 = NULL;
18714 PyObject *__pyx_t_4 = NULL;
18715 PyObject *__pyx_t_5 = NULL;
18716 int __pyx_lineno = 0;
18717 const char *__pyx_filename = NULL;
18718 int __pyx_clineno = 0;
18720 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18722 __Pyx_RefNannySetupContext(
"_err", 0);
18723 __Pyx_TraceCall(
"_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
18724 __Pyx_INCREF(__pyx_v_error);
18733 __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
18734 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18735 if (unlikely(__pyx_t_1)) {
18744 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
18745 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
18746 __Pyx_GOTREF(__pyx_t_3);
18747 __Pyx_INCREF(__pyx_v_error);
18748 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
18749 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18750 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18751 if (likely(__pyx_t_5)) {
18752 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
18753 __Pyx_INCREF(__pyx_t_5);
18754 __Pyx_INCREF(
function);
18755 __Pyx_DECREF_SET(__pyx_t_4,
function);
18758 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
18759 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18760 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18761 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
18762 __Pyx_GOTREF(__pyx_t_2);
18763 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18764 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18765 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18766 __PYX_ERR(1, 1265, __pyx_L1_error)
18784 __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
18786 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18787 __PYX_ERR(1, 1267, __pyx_L1_error)
18800 __Pyx_XDECREF(__pyx_t_2);
18801 __Pyx_XDECREF(__pyx_t_3);
18802 __Pyx_XDECREF(__pyx_t_4);
18803 __Pyx_XDECREF(__pyx_t_5);
18804 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
18806 __Pyx_XDECREF(__pyx_v_error);
18807 __Pyx_TraceReturn(Py_None, 0);
18808 __Pyx_RefNannyFinishContext();
18810 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18823 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
18824 void *__pyx_v_tmpdata;
18825 size_t __pyx_v_itemsize;
18827 char __pyx_v_order;
18828 int __pyx_v_broadcasting;
18829 int __pyx_v_direct_copy;
18830 __Pyx_memviewslice __pyx_v_tmp;
18833 __Pyx_TraceDeclarations
18834 Py_ssize_t __pyx_t_1;
18842 int __pyx_lineno = 0;
18843 const char *__pyx_filename = NULL;
18844 int __pyx_clineno = 0;
18845 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
18854 __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
18855 __pyx_v_tmpdata = NULL;
18864 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
18865 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18866 __pyx_v_itemsize = __pyx_t_1;
18875 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
18876 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18885 __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
18886 __pyx_v_broadcasting = 0;
18895 __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
18896 __pyx_v_direct_copy = 0;
18905 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
18906 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
18916 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
18917 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18936 __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
18937 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
18947 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
18948 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18967 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
18968 __pyx_t_3 = __pyx_v_dst_ndim;
18969 __pyx_t_4 = __pyx_v_src_ndim;
18970 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
18971 __pyx_t_5 = __pyx_t_3;
18973 __pyx_t_5 = __pyx_t_4;
18975 __pyx_v_ndim = __pyx_t_5;
18984 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
18985 __pyx_t_5 = __pyx_v_ndim;
18986 __pyx_t_3 = __pyx_t_5;
18987 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18988 __pyx_v_i = __pyx_t_4;
18997 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
18998 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19008 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
19009 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19019 __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
19020 __pyx_v_broadcasting = 1;
19029 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
19030 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19049 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
19051 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
19071 __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
19072 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19082 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
19083 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
19102 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19103 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19113 __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
19114 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19124 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19125 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19143 __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
19144 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
19145 __pyx_v_tmpdata = __pyx_t_7;
19154 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19155 __pyx_v_src = __pyx_v_tmp;
19173 __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
19174 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19184 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19185 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19195 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19196 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19215 __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
19216 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19226 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19227 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19246 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19247 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19257 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19258 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19267 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19268 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19277 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19278 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19287 __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
19288 free(__pyx_v_tmpdata);
19297 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
19326 __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
19327 __pyx_t_2 = (__pyx_v_order ==
'F');
19329 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19331 __pyx_t_8 = (__pyx_t_2 != 0);
19341 __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
19342 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
19351 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
19352 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
19370 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
19371 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19380 __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
19381 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19390 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
19391 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19400 __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
19401 free(__pyx_v_tmpdata);
19410 __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
19426 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19428 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19430 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19435 __Pyx_TraceReturn(Py_None, 1);
19447 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
19449 int __pyx_v_offset;
19450 __Pyx_TraceDeclarations
19454 int __pyx_lineno = 0;
19455 const char *__pyx_filename = NULL;
19456 int __pyx_clineno = 0;
19457 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
19466 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
19467 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19476 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
19477 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19478 __pyx_v_i = __pyx_t_1;
19487 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
19488 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19497 __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
19498 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19507 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
19508 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19518 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
19519 __pyx_t_1 = __pyx_v_offset;
19520 __pyx_t_2 = __pyx_t_1;
19521 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19522 __pyx_v_i = __pyx_t_3;
19531 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
19532 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19541 __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
19542 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19551 __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
19552 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19566 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19568 __Pyx_TraceReturn(Py_None, 1);
19579 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
19580 __Pyx_TraceDeclarations
19582 int __pyx_lineno = 0;
19583 const char *__pyx_filename = NULL;
19584 int __pyx_clineno = 0;
19585 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
19594 __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
19595 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19605 __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
19606 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19628 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19630 __Pyx_TraceReturn(Py_None, 1);
19641 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19642 __Pyx_TraceDeclarations
19643 __Pyx_RefNannyDeclarations
19644 int __pyx_lineno = 0;
19645 const char *__pyx_filename = NULL;
19646 int __pyx_clineno = 0;
19648 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19650 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
19651 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
19660 __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
19661 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19674 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19676 __Pyx_TraceReturn(Py_None, 0);
19677 __Pyx_RefNannyFinishContext();
19679 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19691 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19692 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19693 __Pyx_TraceDeclarations
19694 __Pyx_RefNannyDeclarations
19695 Py_ssize_t __pyx_t_1;
19696 Py_ssize_t __pyx_t_2;
19697 Py_ssize_t __pyx_t_3;
19699 int __pyx_lineno = 0;
19700 const char *__pyx_filename = NULL;
19701 int __pyx_clineno = 0;
19702 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
19703 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
19712 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
19713 __pyx_t_1 = (__pyx_v_shape[0]);
19714 __pyx_t_2 = __pyx_t_1;
19715 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19716 __pyx_v_i = __pyx_t_3;
19725 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
19726 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19736 __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
19737 __pyx_t_4 = (__pyx_v_inc != 0);
19747 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
19748 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19767 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
19769 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19790 __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
19800 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
19801 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19812 __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
19813 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19827 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19829 __Pyx_TraceReturn(Py_None, 0);
19830 __Pyx_RefNannyFinishContext();
19841 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
19842 __Pyx_TraceDeclarations
19843 int __pyx_lineno = 0;
19844 const char *__pyx_filename = NULL;
19845 int __pyx_clineno = 0;
19846 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
19855 __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
19856 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19865 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
19866 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
19875 __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
19876 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19889 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19891 __Pyx_TraceReturn(Py_None, 1);
19902 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
19903 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19904 Py_ssize_t __pyx_v_stride;
19905 Py_ssize_t __pyx_v_extent;
19906 __Pyx_TraceDeclarations
19908 Py_ssize_t __pyx_t_2;
19909 Py_ssize_t __pyx_t_3;
19910 Py_ssize_t __pyx_t_4;
19911 int __pyx_lineno = 0;
19912 const char *__pyx_filename = NULL;
19913 int __pyx_clineno = 0;
19914 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
19923 __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
19924 __pyx_v_stride = (__pyx_v_strides[0]);
19933 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
19934 __pyx_v_extent = (__pyx_v_shape[0]);
19943 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
19944 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19954 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
19955 __pyx_t_2 = __pyx_v_extent;
19956 __pyx_t_3 = __pyx_t_2;
19957 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19958 __pyx_v_i = __pyx_t_4;
19967 __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
19968 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19977 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
19978 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19998 __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
20000 __pyx_t_2 = __pyx_v_extent;
20001 __pyx_t_3 = __pyx_t_2;
20002 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20003 __pyx_v_i = __pyx_t_4;
20012 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
20013 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20022 __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
20023 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20039 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20041 __Pyx_TraceReturn(Py_None, 1);
20051 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20052 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20053 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20054 PyObject *__pyx_v___pyx_type = 0;
20055 long __pyx_v___pyx_checksum;
20056 PyObject *__pyx_v___pyx_state = 0;
20057 int __pyx_lineno = 0;
20058 const char *__pyx_filename = NULL;
20059 int __pyx_clineno = 0;
20060 PyObject *__pyx_r = 0;
20061 __Pyx_RefNannyDeclarations
20062 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20064 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20065 PyObject* values[3] = {0,0,0};
20066 if (unlikely(__pyx_kwds)) {
20067 Py_ssize_t kw_args;
20068 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20069 switch (pos_args) {
20070 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20071 CYTHON_FALLTHROUGH;
20072 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20073 CYTHON_FALLTHROUGH;
20074 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20075 CYTHON_FALLTHROUGH;
20077 default:
goto __pyx_L5_argtuple_error;
20079 kw_args = PyDict_Size(__pyx_kwds);
20080 switch (pos_args) {
20082 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20083 else goto __pyx_L5_argtuple_error;
20084 CYTHON_FALLTHROUGH;
20086 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20088 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20090 CYTHON_FALLTHROUGH;
20092 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20094 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20097 if (unlikely(kw_args > 0)) {
20098 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20100 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20101 goto __pyx_L5_argtuple_error;
20103 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20104 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20105 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20107 __pyx_v___pyx_type = values[0];
20108 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20109 __pyx_v___pyx_state = values[2];
20111 goto __pyx_L4_argument_unpacking_done;
20112 __pyx_L5_argtuple_error:;
20113 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20115 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20116 __Pyx_RefNannyFinishContext();
20118 __pyx_L4_argument_unpacking_done:;
20119 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20122 __Pyx_RefNannyFinishContext();
20126 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20127 PyObject *__pyx_v___pyx_PickleError = 0;
20128 PyObject *__pyx_v___pyx_result = 0;
20129 PyObject *__pyx_r = NULL;
20130 __Pyx_TraceDeclarations
20131 __Pyx_RefNannyDeclarations
20132 PyObject *__pyx_t_1 = NULL;
20135 PyObject *__pyx_t_4 = NULL;
20136 PyObject *__pyx_t_5 = NULL;
20137 PyObject *__pyx_t_6 = NULL;
20138 int __pyx_lineno = 0;
20139 const char *__pyx_filename = NULL;
20140 int __pyx_clineno = 0;
20141 __Pyx_TraceFrameInit(__pyx_codeobj__36)
20142 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20143 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20152 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20153 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20154 __Pyx_GOTREF(__pyx_t_1);
20155 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__37, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20157 __pyx_t_3 = (__pyx_t_2 != 0);
20167 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20168 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20169 __Pyx_GOTREF(__pyx_t_1);
20170 __Pyx_INCREF(__pyx_n_s_PickleError);
20171 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20172 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20173 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20174 __Pyx_GOTREF(__pyx_t_4);
20175 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20176 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20177 __Pyx_GOTREF(__pyx_t_1);
20178 __Pyx_INCREF(__pyx_t_1);
20179 __pyx_v___pyx_PickleError = __pyx_t_1;
20180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20181 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20190 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20191 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20192 __Pyx_GOTREF(__pyx_t_1);
20193 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20194 __Pyx_GOTREF(__pyx_t_5);
20195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20196 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20197 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20198 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20199 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20200 if (likely(__pyx_t_6)) {
20201 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20202 __Pyx_INCREF(__pyx_t_6);
20203 __Pyx_INCREF(
function);
20204 __Pyx_DECREF_SET(__pyx_t_1,
function);
20207 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
20208 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20209 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20210 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20211 __Pyx_GOTREF(__pyx_t_4);
20212 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20213 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20214 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20215 __PYX_ERR(1, 6, __pyx_L1_error)
20233 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20234 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20235 __Pyx_GOTREF(__pyx_t_1);
20237 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20238 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20239 if (likely(__pyx_t_5)) {
20240 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20241 __Pyx_INCREF(__pyx_t_5);
20242 __Pyx_INCREF(
function);
20243 __Pyx_DECREF_SET(__pyx_t_1,
function);
20246 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
20247 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20248 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20249 __Pyx_GOTREF(__pyx_t_4);
20250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20251 __pyx_v___pyx_result = __pyx_t_4;
20261 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20262 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20263 __pyx_t_2 = (__pyx_t_3 != 0);
20273 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20274 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20275 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20276 __Pyx_GOTREF(__pyx_t_4);
20277 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20295 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20296 __Pyx_XDECREF(__pyx_r);
20297 __Pyx_INCREF(__pyx_v___pyx_result);
20298 __pyx_r = __pyx_v___pyx_result;
20309 __Pyx_XDECREF(__pyx_t_1);
20310 __Pyx_XDECREF(__pyx_t_4);
20311 __Pyx_XDECREF(__pyx_t_5);
20312 __Pyx_XDECREF(__pyx_t_6);
20313 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20316 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20317 __Pyx_XDECREF(__pyx_v___pyx_result);
20318 __Pyx_XGIVEREF(__pyx_r);
20319 __Pyx_TraceReturn(__pyx_r, 0);
20320 __Pyx_RefNannyFinishContext();
20332 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20333 PyObject *__pyx_r = NULL;
20334 __Pyx_TraceDeclarations
20335 __Pyx_RefNannyDeclarations
20336 PyObject *__pyx_t_1 = NULL;
20338 Py_ssize_t __pyx_t_3;
20341 PyObject *__pyx_t_6 = NULL;
20342 PyObject *__pyx_t_7 = NULL;
20343 PyObject *__pyx_t_8 = NULL;
20344 int __pyx_lineno = 0;
20345 const char *__pyx_filename = NULL;
20346 int __pyx_clineno = 0;
20347 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20348 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20357 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
20358 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20359 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20360 __PYX_ERR(1, 12, __pyx_L1_error)
20362 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20363 __Pyx_GOTREF(__pyx_t_1);
20364 __Pyx_GIVEREF(__pyx_t_1);
20365 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20366 __Pyx_DECREF(__pyx_v___pyx_result->name);
20367 __pyx_v___pyx_result->name = __pyx_t_1;
20376 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
20377 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20378 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20379 __PYX_ERR(1, 13, __pyx_L1_error)
20381 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20382 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20385 __pyx_t_2 = __pyx_t_4;
20386 goto __pyx_L4_bool_binop_done;
20388 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20389 __pyx_t_5 = (__pyx_t_4 != 0);
20390 __pyx_t_2 = __pyx_t_5;
20391 __pyx_L4_bool_binop_done:;
20399 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
20400 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20401 __Pyx_GOTREF(__pyx_t_6);
20402 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20403 __Pyx_GOTREF(__pyx_t_7);
20404 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20405 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20406 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20407 __PYX_ERR(1, 14, __pyx_L1_error)
20409 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20410 __Pyx_GOTREF(__pyx_t_6);
20412 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20413 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20414 if (likely(__pyx_t_8)) {
20415 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
20416 __Pyx_INCREF(__pyx_t_8);
20417 __Pyx_INCREF(
function);
20418 __Pyx_DECREF_SET(__pyx_t_7,
function);
20421 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20422 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20423 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20424 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20425 __Pyx_GOTREF(__pyx_t_1);
20426 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20427 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20446 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20449 __Pyx_XDECREF(__pyx_t_1);
20450 __Pyx_XDECREF(__pyx_t_6);
20451 __Pyx_XDECREF(__pyx_t_7);
20452 __Pyx_XDECREF(__pyx_t_8);
20453 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20456 __Pyx_XGIVEREF(__pyx_r);
20457 __Pyx_TraceReturn(__pyx_r, 0);
20458 __Pyx_RefNannyFinishContext();
20461 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
20463 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20464 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p;
20466 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20467 o = (*t->tp_alloc)(t, 0);
20469 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20471 if (unlikely(!o))
return 0;
20472 p = ((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o);
20473 p->__pyx_vtab = __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
20474 p->parameters = Py_None; Py_INCREF(Py_None);
20475 if (unlikely(__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_1__cinit__(o, __pyx_empty_tuple, NULL) < 0))
goto bad;
20478 Py_DECREF(o); o = 0;
20482 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyObject *o) {
20483 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p = (
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o;
20484 #if CYTHON_USE_TP_FINALIZE
20485 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20486 if (PyObject_CallFinalizerFromDealloc(o))
return;
20489 PyObject_GC_UnTrack(o);
20491 PyObject *etype, *eval, *etb;
20492 PyErr_Fetch(&etype, &eval, &etb);
20493 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20494 __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_3__dealloc__(o);
20495 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20496 PyErr_Restore(etype, eval, etb);
20498 Py_CLEAR(p->parameters);
20499 (*Py_TYPE(o)->tp_free)(o);
20502 static int __pyx_tp_traverse_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyObject *o, visitproc v,
void *a) {
20504 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p = (
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o;
20505 if (p->parameters) {
20506 e = (*v)(p->parameters, a);
if (e)
return e;
20511 static int __pyx_tp_clear_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyObject *o) {
20513 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p = (
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o;
20514 tmp = ((PyObject*)p->parameters);
20515 p->parameters = Py_None; Py_INCREF(Py_None);
20520 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator[] = {
20521 {
"get_num_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters},
20522 {
"get_data_type_name", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name},
20523 {
"set_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters},
20524 {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__},
20525 {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__},
20529 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = {
20530 PyVarObject_HEAD_INIT(0, 0)
20531 "imate._c_linear_operator.py_c_linear_operator.pycLinearOperator",
20532 sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),
20534 __pyx_tp_dealloc_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20535 #
if PY_VERSION_HEX < 0x030800b4
20538 #
if PY_VERSION_HEX >= 0x030800b4
20543 #
if PY_MAJOR_VERSION < 3
20546 #
if PY_MAJOR_VERSION >= 3
20559 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20561 __pyx_tp_traverse_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20562 __pyx_tp_clear_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20567 __pyx_methods_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20577 __pyx_tp_new_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20587 #
if PY_VERSION_HEX >= 0x030400a1
20590 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20593 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20596 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20600 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20602 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20603 struct __pyx_array_obj *p;
20605 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20606 o = (*t->tp_alloc)(t, 0);
20608 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20610 if (unlikely(!o))
return 0;
20611 p = ((
struct __pyx_array_obj *)o);
20612 p->__pyx_vtab = __pyx_vtabptr_array;
20613 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20614 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20615 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
20618 Py_DECREF(o); o = 0;
20622 static void __pyx_tp_dealloc_array(PyObject *o) {
20623 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
20624 #if CYTHON_USE_TP_FINALIZE
20625 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
20626 if (PyObject_CallFinalizerFromDealloc(o))
return;
20630 PyObject *etype, *eval, *etb;
20631 PyErr_Fetch(&etype, &eval, &etb);
20632 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20633 __pyx_array___dealloc__(o);
20634 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20635 PyErr_Restore(etype, eval, etb);
20638 Py_CLEAR(p->_format);
20639 (*Py_TYPE(o)->tp_free)(o);
20641 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20643 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
20644 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20649 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20651 return __pyx_array___setitem__(o, i, v);
20654 PyErr_Format(PyExc_NotImplementedError,
20655 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20660 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
20661 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
20662 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20664 v = __pyx_array___getattr__(o, n);
20669 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
20670 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20673 static PyMethodDef __pyx_methods_array[] = {
20674 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20675 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20676 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20680 static struct PyGetSetDef __pyx_getsets_array[] = {
20681 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
20685 static PySequenceMethods __pyx_tp_as_sequence_array = {
20686 __pyx_array___len__,
20689 __pyx_sq_item_array,
20698 static PyMappingMethods __pyx_tp_as_mapping_array = {
20699 __pyx_array___len__,
20700 __pyx_array___getitem__,
20701 __pyx_mp_ass_subscript_array,
20704 static PyBufferProcs __pyx_tp_as_buffer_array = {
20705 #if PY_MAJOR_VERSION < 3
20708 #if PY_MAJOR_VERSION < 3
20711 #if PY_MAJOR_VERSION < 3
20714 #if PY_MAJOR_VERSION < 3
20717 __pyx_array_getbuffer,
20721 static PyTypeObject __pyx_type___pyx_array = {
20722 PyVarObject_HEAD_INIT(0, 0)
20723 "imate._c_linear_operator.py_c_linear_operator.array",
20724 sizeof(
struct __pyx_array_obj),
20726 __pyx_tp_dealloc_array,
20727 #
if PY_VERSION_HEX < 0x030800b4
20730 #
if PY_VERSION_HEX >= 0x030800b4
20735 #
if PY_MAJOR_VERSION < 3
20738 #
if PY_MAJOR_VERSION >= 3
20743 &__pyx_tp_as_sequence_array,
20744 &__pyx_tp_as_mapping_array,
20748 __pyx_tp_getattro_array,
20750 &__pyx_tp_as_buffer_array,
20751 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
20759 __pyx_methods_array,
20761 __pyx_getsets_array,
20769 __pyx_tp_new_array,
20779 #
if PY_VERSION_HEX >= 0x030400a1
20782 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20785 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20788 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20793 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20794 struct __pyx_MemviewEnum_obj *p;
20796 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20797 o = (*t->tp_alloc)(t, 0);
20799 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20801 if (unlikely(!o))
return 0;
20802 p = ((
struct __pyx_MemviewEnum_obj *)o);
20803 p->name = Py_None; Py_INCREF(Py_None);
20807 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20808 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20809 #if CYTHON_USE_TP_FINALIZE
20810 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20811 if (PyObject_CallFinalizerFromDealloc(o))
return;
20814 PyObject_GC_UnTrack(o);
20816 (*Py_TYPE(o)->tp_free)(o);
20819 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
20821 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20823 e = (*v)(p->name, a);
if (e)
return e;
20828 static int __pyx_tp_clear_Enum(PyObject *o) {
20830 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20831 tmp = ((PyObject*)p->name);
20832 p->name = Py_None; Py_INCREF(Py_None);
20837 static PyMethodDef __pyx_methods_Enum[] = {
20838 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20839 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20843 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20844 PyVarObject_HEAD_INIT(0, 0)
20845 "imate._c_linear_operator.py_c_linear_operator.Enum",
20846 sizeof(
struct __pyx_MemviewEnum_obj),
20848 __pyx_tp_dealloc_Enum,
20849 #
if PY_VERSION_HEX < 0x030800b4
20852 #
if PY_VERSION_HEX >= 0x030800b4
20857 #
if PY_MAJOR_VERSION < 3
20860 #
if PY_MAJOR_VERSION >= 3
20863 __pyx_MemviewEnum___repr__,
20873 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20875 __pyx_tp_traverse_Enum,
20876 __pyx_tp_clear_Enum,
20881 __pyx_methods_Enum,
20889 __pyx_MemviewEnum___init__,
20901 #
if PY_VERSION_HEX >= 0x030400a1
20904 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20907 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20910 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20914 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20916 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20917 struct __pyx_memoryview_obj *p;
20919 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20920 o = (*t->tp_alloc)(t, 0);
20922 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20924 if (unlikely(!o))
return 0;
20925 p = ((
struct __pyx_memoryview_obj *)o);
20926 p->__pyx_vtab = __pyx_vtabptr_memoryview;
20927 p->obj = Py_None; Py_INCREF(Py_None);
20928 p->_size = Py_None; Py_INCREF(Py_None);
20929 p->_array_interface = Py_None; Py_INCREF(Py_None);
20930 p->view.obj = NULL;
20931 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
20934 Py_DECREF(o); o = 0;
20938 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20939 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20940 #if CYTHON_USE_TP_FINALIZE
20941 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20942 if (PyObject_CallFinalizerFromDealloc(o))
return;
20945 PyObject_GC_UnTrack(o);
20947 PyObject *etype, *eval, *etb;
20948 PyErr_Fetch(&etype, &eval, &etb);
20949 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20950 __pyx_memoryview___dealloc__(o);
20951 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20952 PyErr_Restore(etype, eval, etb);
20955 Py_CLEAR(p->_size);
20956 Py_CLEAR(p->_array_interface);
20957 (*Py_TYPE(o)->tp_free)(o);
20960 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
20962 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20964 e = (*v)(p->obj, a);
if (e)
return e;
20967 e = (*v)(p->_size, a);
if (e)
return e;
20969 if (p->_array_interface) {
20970 e = (*v)(p->_array_interface, a);
if (e)
return e;
20973 e = (*v)(p->view.obj, a);
if (e)
return e;
20978 static int __pyx_tp_clear_memoryview(PyObject *o) {
20980 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20981 tmp = ((PyObject*)p->obj);
20982 p->obj = Py_None; Py_INCREF(Py_None);
20984 tmp = ((PyObject*)p->_size);
20985 p->_size = Py_None; Py_INCREF(Py_None);
20987 tmp = ((PyObject*)p->_array_interface);
20988 p->_array_interface = Py_None; Py_INCREF(Py_None);
20990 Py_CLEAR(p->view.obj);
20993 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20995 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
20996 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21001 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21003 return __pyx_memoryview___setitem__(o, i, v);
21006 PyErr_Format(PyExc_NotImplementedError,
21007 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21012 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
21013 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21016 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
21017 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21020 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
21021 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21024 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
21025 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21028 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
21029 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21032 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
21033 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21036 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
21037 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21040 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
21041 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21044 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
21045 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21048 static PyMethodDef __pyx_methods_memoryview[] = {
21049 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21050 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21051 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21052 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21053 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21054 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21058 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21059 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
21060 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
21061 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
21062 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
21063 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
21064 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
21065 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
21066 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
21067 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
21071 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21072 __pyx_memoryview___len__,
21075 __pyx_sq_item_memoryview,
21084 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21085 __pyx_memoryview___len__,
21086 __pyx_memoryview___getitem__,
21087 __pyx_mp_ass_subscript_memoryview,
21090 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21091 #if PY_MAJOR_VERSION < 3
21094 #if PY_MAJOR_VERSION < 3
21097 #if PY_MAJOR_VERSION < 3
21100 #if PY_MAJOR_VERSION < 3
21103 __pyx_memoryview_getbuffer,
21107 static PyTypeObject __pyx_type___pyx_memoryview = {
21108 PyVarObject_HEAD_INIT(0, 0)
21109 "imate._c_linear_operator.py_c_linear_operator.memoryview",
21110 sizeof(
struct __pyx_memoryview_obj),
21112 __pyx_tp_dealloc_memoryview,
21113 #
if PY_VERSION_HEX < 0x030800b4
21116 #
if PY_VERSION_HEX >= 0x030800b4
21121 #
if PY_MAJOR_VERSION < 3
21124 #
if PY_MAJOR_VERSION >= 3
21127 __pyx_memoryview___repr__,
21129 &__pyx_tp_as_sequence_memoryview,
21130 &__pyx_tp_as_mapping_memoryview,
21133 __pyx_memoryview___str__,
21136 &__pyx_tp_as_buffer_memoryview,
21137 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21139 __pyx_tp_traverse_memoryview,
21140 __pyx_tp_clear_memoryview,
21145 __pyx_methods_memoryview,
21147 __pyx_getsets_memoryview,
21155 __pyx_tp_new_memoryview,
21165 #
if PY_VERSION_HEX >= 0x030400a1
21168 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21171 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21174 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21178 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21180 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21181 struct __pyx_memoryviewslice_obj *p;
21182 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21183 if (unlikely(!o))
return 0;
21184 p = ((
struct __pyx_memoryviewslice_obj *)o);
21185 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21186 p->from_object = Py_None; Py_INCREF(Py_None);
21187 p->from_slice.memview = NULL;
21191 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21192 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21193 #if CYTHON_USE_TP_FINALIZE
21194 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21195 if (PyObject_CallFinalizerFromDealloc(o))
return;
21198 PyObject_GC_UnTrack(o);
21200 PyObject *etype, *eval, *etb;
21201 PyErr_Fetch(&etype, &eval, &etb);
21202 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21203 __pyx_memoryviewslice___dealloc__(o);
21204 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21205 PyErr_Restore(etype, eval, etb);
21207 Py_CLEAR(p->from_object);
21208 PyObject_GC_Track(o);
21209 __pyx_tp_dealloc_memoryview(o);
21212 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
21214 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21215 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
21216 if (p->from_object) {
21217 e = (*v)(p->from_object, a);
if (e)
return e;
21222 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21224 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21225 __pyx_tp_clear_memoryview(o);
21226 tmp = ((PyObject*)p->from_object);
21227 p->from_object = Py_None; Py_INCREF(Py_None);
21229 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21233 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21234 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21237 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21238 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21239 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21243 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21244 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
21248 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21249 PyVarObject_HEAD_INIT(0, 0)
21250 "imate._c_linear_operator.py_c_linear_operator._memoryviewslice",
21251 sizeof(
struct __pyx_memoryviewslice_obj),
21253 __pyx_tp_dealloc__memoryviewslice,
21254 #
if PY_VERSION_HEX < 0x030800b4
21257 #
if PY_VERSION_HEX >= 0x030800b4
21262 #
if PY_MAJOR_VERSION < 3
21265 #
if PY_MAJOR_VERSION >= 3
21268 #
if CYTHON_COMPILING_IN_PYPY
21269 __pyx_memoryview___repr__,
21278 #
if CYTHON_COMPILING_IN_PYPY
21279 __pyx_memoryview___str__,
21286 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21287 "Internal class for passing memoryview slices to Python",
21288 __pyx_tp_traverse__memoryviewslice,
21289 __pyx_tp_clear__memoryviewslice,
21294 __pyx_methods__memoryviewslice,
21296 __pyx_getsets__memoryviewslice,
21304 __pyx_tp_new__memoryviewslice,
21314 #
if PY_VERSION_HEX >= 0x030400a1
21317 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21320 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21323 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21328 static PyMethodDef __pyx_methods[] = {
21332 #if PY_MAJOR_VERSION >= 3
21333 #if CYTHON_PEP489_MULTI_PHASE_INIT
21334 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
21335 static int __pyx_pymod_exec_py_c_linear_operator(PyObject* module);
21336 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21337 {Py_mod_create, (
void*)__pyx_pymod_create},
21338 {Py_mod_exec, (
void*)__pyx_pymod_exec_py_c_linear_operator},
21343 static struct PyModuleDef __pyx_moduledef = {
21344 PyModuleDef_HEAD_INIT,
21345 "py_c_linear_operator",
21347 #if CYTHON_PEP489_MULTI_PHASE_INIT
21353 #if CYTHON_PEP489_MULTI_PHASE_INIT
21354 __pyx_moduledef_slots,
21363 #ifndef CYTHON_SMALL_CODE
21364 #if defined(__clang__)
21365 #define CYTHON_SMALL_CODE
21366 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21367 #define CYTHON_SMALL_CODE __attribute__((cold))
21369 #define CYTHON_SMALL_CODE
21373 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21374 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21375 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
21376 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
21377 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
21378 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
21379 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
21380 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21381 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
21382 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
21383 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21384 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21385 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
21386 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
21387 {&__pyx_kp_u_LinearOperator_object_is_s, __pyx_k_LinearOperator_object_is_s,
sizeof(__pyx_k_LinearOperator_object_is_s), 0, 1, 0, 0},
21388 {&__pyx_kp_u_Linear_operator_data_type_is_not, __pyx_k_Linear_operator_data_type_is_not,
sizeof(__pyx_k_Linear_operator_data_type_is_not), 0, 1, 0, 0},
21389 {&__pyx_kp_u_Linear_operator_double_type_is_n, __pyx_k_Linear_operator_double_type_is_n,
sizeof(__pyx_k_Linear_operator_double_type_is_n), 0, 1, 0, 0},
21390 {&__pyx_kp_u_Linear_operator_float_type_is_no, __pyx_k_Linear_operator_float_type_is_no,
sizeof(__pyx_k_Linear_operator_float_type_is_no), 0, 1, 0, 0},
21391 {&__pyx_kp_u_Linear_operator_is_not_set, __pyx_k_Linear_operator_is_not_set,
sizeof(__pyx_k_Linear_operator_is_not_set), 0, 1, 0, 0},
21392 {&__pyx_kp_u_Linear_operator_long_double_type, __pyx_k_Linear_operator_long_double_type,
sizeof(__pyx_k_Linear_operator_long_double_type), 0, 1, 0, 0},
21393 {&__pyx_kp_u_LongIndexType_has_an_unconventi, __pyx_k_LongIndexType_has_an_unconventi,
sizeof(__pyx_k_LongIndexType_has_an_unconventi), 0, 1, 0, 0},
21394 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21395 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
21396 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21397 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
21398 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
21399 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21400 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
21401 {&__pyx_kp_u_The_input_vector_and_product_sho, __pyx_k_The_input_vector_and_product_sho,
sizeof(__pyx_k_The_input_vector_and_product_sho), 0, 1, 0, 0},
21402 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21403 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
21404 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21405 {&__pyx_kp_u_Vector_type_should_be_either_flo, __pyx_k_Vector_type_should_be_either_flo,
sizeof(__pyx_k_Vector_type_should_be_either_flo), 0, 1, 0, 0},
21406 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21407 {&__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_k_Wrong_accessors_is_called_The_ty,
sizeof(__pyx_k_Wrong_accessors_is_called_The_ty), 0, 1, 0, 0},
21408 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21409 {&__pyx_n_s_array, __pyx_k_array,
sizeof(__pyx_k_array), 0, 0, 1, 1},
21410 {&__pyx_n_s_astype, __pyx_k_astype,
sizeof(__pyx_k_astype), 0, 0, 1, 1},
21411 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
21412 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
21413 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
21414 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
21415 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21416 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21417 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21418 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
21419 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
21420 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
21421 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21422 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
21423 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21424 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
21425 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
21426 {&__pyx_n_b_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 0, 0, 1},
21427 {&__pyx_n_u_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 1, 0, 1},
21428 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
21429 {&__pyx_n_u_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 1, 0, 1},
21430 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
21431 {&__pyx_n_u_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 1, 0, 1},
21432 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
21433 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21434 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21435 {&__pyx_n_s_get_data_type_name, __pyx_k_get_data_type_name,
sizeof(__pyx_k_get_data_type_name), 0, 0, 1, 1},
21436 {&__pyx_n_s_get_num_parameters, __pyx_k_get_num_parameters,
sizeof(__pyx_k_get_num_parameters), 0, 0, 1, 1},
21437 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21438 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
21439 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
21440 {&__pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_k_imate__c_linear_operator_py_c_li,
sizeof(__pyx_k_imate__c_linear_operator_py_c_li), 0, 0, 1, 0},
21441 {&__pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_k_imate__c_linear_operator_py_c_li_2,
sizeof(__pyx_k_imate__c_linear_operator_py_c_li_2), 0, 0, 1, 1},
21442 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
21443 {&__pyx_n_s_isscalar, __pyx_k_isscalar,
sizeof(__pyx_k_isscalar), 0, 0, 1, 1},
21444 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21445 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
21446 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
21447 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
21448 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
21449 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
21450 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21451 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21452 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
21453 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
21454 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21455 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
21456 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
21457 {&__pyx_n_s_parameters, __pyx_k_parameters,
sizeof(__pyx_k_parameters), 0, 0, 1, 1},
21458 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21459 {&__pyx_n_s_product, __pyx_k_product,
sizeof(__pyx_k_product), 0, 0, 1, 1},
21460 {&__pyx_n_s_pycLinearOperator, __pyx_k_pycLinearOperator,
sizeof(__pyx_k_pycLinearOperator), 0, 0, 1, 1},
21461 {&__pyx_n_s_pycLinearOperator___reduce_cytho, __pyx_k_pycLinearOperator___reduce_cytho,
sizeof(__pyx_k_pycLinearOperator___reduce_cytho), 0, 0, 1, 1},
21462 {&__pyx_n_s_pycLinearOperator___setstate_cyt, __pyx_k_pycLinearOperator___setstate_cyt,
sizeof(__pyx_k_pycLinearOperator___setstate_cyt), 0, 0, 1, 1},
21463 {&__pyx_n_s_pycLinearOperator_dot, __pyx_k_pycLinearOperator_dot,
sizeof(__pyx_k_pycLinearOperator_dot), 0, 0, 1, 1},
21464 {&__pyx_n_s_pycLinearOperator_get_data_type, __pyx_k_pycLinearOperator_get_data_type,
sizeof(__pyx_k_pycLinearOperator_get_data_type), 0, 0, 1, 1},
21465 {&__pyx_n_s_pycLinearOperator_get_num_parame, __pyx_k_pycLinearOperator_get_num_parame,
sizeof(__pyx_k_pycLinearOperator_get_num_parame), 0, 0, 1, 1},
21466 {&__pyx_n_s_pycLinearOperator_set_parameters, __pyx_k_pycLinearOperator_set_parameters,
sizeof(__pyx_k_pycLinearOperator_set_parameters), 0, 0, 1, 1},
21467 {&__pyx_n_s_pycLinearOperator_transpose_dot, __pyx_k_pycLinearOperator_transpose_dot,
sizeof(__pyx_k_pycLinearOperator_transpose_dot), 0, 0, 1, 1},
21468 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21469 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21470 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21471 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21472 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21473 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21474 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21475 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21476 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
21477 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21478 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21479 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21480 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
21481 {&__pyx_n_s_set_parameters, __pyx_k_set_parameters,
sizeof(__pyx_k_set_parameters), 0, 0, 1, 1},
21482 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21483 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21484 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
21485 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
21486 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
21487 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
21488 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
21489 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21490 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21491 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21492 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21493 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
21494 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
21495 {&__pyx_n_s_transpose_dot, __pyx_k_transpose_dot,
sizeof(__pyx_k_transpose_dot), 0, 0, 1, 1},
21496 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21497 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21498 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21499 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
21500 {&__pyx_n_s_vector, __pyx_k_vector,
sizeof(__pyx_k_vector), 0, 0, 1, 1},
21501 {0, 0, 0, 0, 0, 0, 0}
21503 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
21504 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 67, __pyx_L1_error)
21505 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 107, __pyx_L1_error)
21506 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 158, __pyx_L1_error)
21507 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
21508 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
21509 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
21510 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
21511 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
21512 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
21518 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
21519 __Pyx_RefNannyDeclarations
21520 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
21529 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_LongIndexType_has_an_unconventi);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 67, __pyx_L1_error)
21530 __Pyx_GOTREF(__pyx_tuple_);
21531 __Pyx_GIVEREF(__pyx_tuple_);
21540 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_is_not_set);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 107, __pyx_L1_error)
21541 __Pyx_GOTREF(__pyx_tuple__2);
21542 __Pyx_GIVEREF(__pyx_tuple__2);
21551 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_data_type_is_not);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 158, __pyx_L1_error)
21552 __Pyx_GOTREF(__pyx_tuple__5);
21553 __Pyx_GIVEREF(__pyx_tuple__5);
21562 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_float_type_is_no);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 171, __pyx_L1_error)
21563 __Pyx_GOTREF(__pyx_tuple__6);
21564 __Pyx_GIVEREF(__pyx_tuple__6);
21573 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_double_type_is_n);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 189, __pyx_L1_error)
21574 __Pyx_GOTREF(__pyx_tuple__7);
21575 __Pyx_GIVEREF(__pyx_tuple__7);
21584 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_long_double_type);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 208, __pyx_L1_error)
21585 __Pyx_GOTREF(__pyx_tuple__8);
21586 __Pyx_GIVEREF(__pyx_tuple__8);
21595 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_The_input_vector_and_product_sho);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 243, __pyx_L1_error)
21596 __Pyx_GOTREF(__pyx_tuple__11);
21597 __Pyx_GIVEREF(__pyx_tuple__11);
21606 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Vector_type_should_be_either_flo);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 335, __pyx_L1_error)
21607 __Pyx_GOTREF(__pyx_tuple__12);
21608 __Pyx_GIVEREF(__pyx_tuple__12);
21616 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
21617 __Pyx_GOTREF(__pyx_tuple__15);
21618 __Pyx_GIVEREF(__pyx_tuple__15);
21625 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
21626 __Pyx_GOTREF(__pyx_tuple__17);
21627 __Pyx_GIVEREF(__pyx_tuple__17);
21636 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 134, __pyx_L1_error)
21637 __Pyx_GOTREF(__pyx_tuple__18);
21638 __Pyx_GIVEREF(__pyx_tuple__18);
21647 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 137, __pyx_L1_error)
21648 __Pyx_GOTREF(__pyx_tuple__19);
21649 __Pyx_GIVEREF(__pyx_tuple__19);
21658 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 149, __pyx_L1_error)
21659 __Pyx_GOTREF(__pyx_tuple__20);
21660 __Pyx_GIVEREF(__pyx_tuple__20);
21669 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 177, __pyx_L1_error)
21670 __Pyx_GOTREF(__pyx_tuple__21);
21671 __Pyx_GIVEREF(__pyx_tuple__21);
21680 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 193, __pyx_L1_error)
21681 __Pyx_GOTREF(__pyx_tuple__22);
21682 __Pyx_GIVEREF(__pyx_tuple__22);
21690 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
21691 __Pyx_GOTREF(__pyx_tuple__23);
21692 __Pyx_GIVEREF(__pyx_tuple__23);
21699 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
21700 __Pyx_GOTREF(__pyx_tuple__24);
21701 __Pyx_GIVEREF(__pyx_tuple__24);
21710 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 420, __pyx_L1_error)
21711 __Pyx_GOTREF(__pyx_tuple__25);
21712 __Pyx_GIVEREF(__pyx_tuple__25);
21721 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 497, __pyx_L1_error)
21722 __Pyx_GOTREF(__pyx_tuple__26);
21723 __Pyx_GIVEREF(__pyx_tuple__26);
21732 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 522, __pyx_L1_error)
21733 __Pyx_GOTREF(__pyx_tuple__27);
21734 __Pyx_GIVEREF(__pyx_tuple__27);
21743 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 572, __pyx_L1_error)
21744 __Pyx_GOTREF(__pyx_tuple__28);
21745 __Pyx_GIVEREF(__pyx_tuple__28);
21754 __pyx_tuple__29 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 579, __pyx_L1_error)
21755 __Pyx_GOTREF(__pyx_tuple__29);
21756 __Pyx_INCREF(__pyx_int_neg_1);
21757 __Pyx_GIVEREF(__pyx_int_neg_1);
21758 PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
21759 __Pyx_GIVEREF(__pyx_tuple__29);
21767 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
21768 __Pyx_GOTREF(__pyx_tuple__30);
21769 __Pyx_GIVEREF(__pyx_tuple__30);
21776 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
21777 __Pyx_GOTREF(__pyx_tuple__31);
21778 __Pyx_GIVEREF(__pyx_tuple__31);
21787 __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 684, __pyx_L1_error)
21788 __Pyx_GOTREF(__pyx_slice__32);
21789 __Pyx_GIVEREF(__pyx_slice__32);
21798 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 705, __pyx_L1_error)
21799 __Pyx_GOTREF(__pyx_tuple__33);
21800 __Pyx_GIVEREF(__pyx_tuple__33);
21808 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
21809 __Pyx_GOTREF(__pyx_tuple__34);
21810 __Pyx_GIVEREF(__pyx_tuple__34);
21817 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
21818 __Pyx_GOTREF(__pyx_tuple__35);
21819 __Pyx_GIVEREF(__pyx_tuple__35);
21820 __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error)
21821 __Pyx_GOTREF(__pyx_tuple__37);
21822 __Pyx_GIVEREF(__pyx_tuple__37);
21831 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 133, __pyx_L1_error)
21832 __Pyx_GOTREF(__pyx_tuple__38);
21833 __Pyx_GIVEREF(__pyx_tuple__38);
21834 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_get_num_parameters, 133, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 133, __pyx_L1_error)
21843 __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 153, __pyx_L1_error)
21844 __Pyx_GOTREF(__pyx_tuple__39);
21845 __Pyx_GIVEREF(__pyx_tuple__39);
21846 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_get_data_type_name, 153, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 153, __pyx_L1_error)
21855 __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_parameters);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 222, __pyx_L1_error)
21856 __Pyx_GOTREF(__pyx_tuple__40);
21857 __Pyx_GIVEREF(__pyx_tuple__40);
21858 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_set_parameters, 222, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 222, __pyx_L1_error)
21867 __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_vector, __pyx_n_s_product);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 238, __pyx_L1_error)
21868 __Pyx_GOTREF(__pyx_tuple__41);
21869 __Pyx_GIVEREF(__pyx_tuple__41);
21870 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_dot, 238, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 238, __pyx_L1_error)
21879 __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_vector, __pyx_n_s_product);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 342, __pyx_L1_error)
21880 __Pyx_GOTREF(__pyx_tuple__42);
21881 __Pyx_GIVEREF(__pyx_tuple__42);
21882 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_transpose_dot, 342, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 342, __pyx_L1_error)
21889 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 1, __pyx_L1_error)
21890 __Pyx_GOTREF(__pyx_tuple__43);
21891 __Pyx_GIVEREF(__pyx_tuple__43);
21892 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
21900 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 3, __pyx_L1_error)
21901 __Pyx_GOTREF(__pyx_tuple__44);
21902 __Pyx_GIVEREF(__pyx_tuple__44);
21903 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
21912 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 287, __pyx_L1_error)
21913 __Pyx_GOTREF(__pyx_tuple__45);
21914 __Pyx_GIVEREF(__pyx_tuple__45);
21923 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 288, __pyx_L1_error)
21924 __Pyx_GOTREF(__pyx_tuple__46);
21925 __Pyx_GIVEREF(__pyx_tuple__46);
21934 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 289, __pyx_L1_error)
21935 __Pyx_GOTREF(__pyx_tuple__47);
21936 __Pyx_GIVEREF(__pyx_tuple__47);
21945 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 292, __pyx_L1_error)
21946 __Pyx_GOTREF(__pyx_tuple__48);
21947 __Pyx_GIVEREF(__pyx_tuple__48);
21956 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 293, __pyx_L1_error)
21957 __Pyx_GOTREF(__pyx_tuple__49);
21958 __Pyx_GIVEREF(__pyx_tuple__49);
21965 __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 1, __pyx_L1_error)
21966 __Pyx_GOTREF(__pyx_tuple__50);
21967 __Pyx_GIVEREF(__pyx_tuple__50);
21968 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
21969 __Pyx_RefNannyFinishContext();
21972 __Pyx_RefNannyFinishContext();
21976 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
21978 __Pyx_init_assertions_enabled();
21980 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21982 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21983 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
21984 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21985 __pyx_int_112105877 = PyInt_FromLong(112105877L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
21986 __pyx_int_136983863 = PyInt_FromLong(136983863L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
21987 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
21988 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21994 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
21995 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
21996 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
21997 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
21998 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
21999 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
22000 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
22002 static int __Pyx_modinit_global_init_code(
void) {
22003 __Pyx_RefNannyDeclarations
22004 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22006 generic = Py_None; Py_INCREF(Py_None);
22007 strided = Py_None; Py_INCREF(Py_None);
22008 indirect = Py_None; Py_INCREF(Py_None);
22009 contiguous = Py_None; Py_INCREF(Py_None);
22010 indirect_contiguous = Py_None; Py_INCREF(Py_None);
22011 __Pyx_RefNannyFinishContext();
22015 static int __Pyx_modinit_variable_export_code(
void) {
22016 __Pyx_RefNannyDeclarations
22017 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22019 __Pyx_RefNannyFinishContext();
22023 static int __Pyx_modinit_function_export_code(
void) {
22024 __Pyx_RefNannyDeclarations
22025 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22027 __Pyx_RefNannyFinishContext();
22031 static int __Pyx_modinit_type_init_code(
void) {
22032 __Pyx_RefNannyDeclarations
22033 int __pyx_lineno = 0;
22034 const char *__pyx_filename = NULL;
22035 int __pyx_clineno = 0;
22036 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22038 __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = &__pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22039 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_num_rows = (__pyx_t_5imate_12_definitions_5types_LongIndexType (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_rows;
22040 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_num_columns = (__pyx_t_5imate_12_definitions_5types_LongIndexType (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_columns;
22041 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_linear_operator_float = (
cLinearOperator<float> *(*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_float;
22042 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_linear_operator_double = (
cLinearOperator<double> *(*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_double;
22043 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_linear_operator_long_double = (
cLinearOperator<long double> *(*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_long_double;
22044 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.dot = (void (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot;
22045 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.transpose_dot = (void (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot;
22046 if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
22047 #if PY_VERSION_HEX < 0x030800B1
22048 __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_print = 0;
22050 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_getattro == PyObject_GenericGetAttr)) {
22051 __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22053 if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
22054 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycLinearOperator, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
22055 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
22056 __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = &__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22057 __pyx_vtabptr_array = &__pyx_vtable_array;
22058 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
22059 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22060 #if PY_VERSION_HEX < 0x030800B1
22061 __pyx_type___pyx_array.tp_print = 0;
22063 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22064 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22065 __pyx_array_type = &__pyx_type___pyx_array;
22066 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22067 #if PY_VERSION_HEX < 0x030800B1
22068 __pyx_type___pyx_MemviewEnum.tp_print = 0;
22070 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22071 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22073 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22074 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22075 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22076 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22077 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22078 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22079 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22080 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22081 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
22082 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22083 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22084 #if PY_VERSION_HEX < 0x030800B1
22085 __pyx_type___pyx_memoryview.tp_print = 0;
22087 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22088 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22090 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22091 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22092 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22093 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22094 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22095 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
22096 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22097 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22098 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22099 #if PY_VERSION_HEX < 0x030800B1
22100 __pyx_type___pyx_memoryviewslice.tp_print = 0;
22102 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22103 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22105 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22106 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22107 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22108 __Pyx_RefNannyFinishContext();
22111 __Pyx_RefNannyFinishContext();
22115 static int __Pyx_modinit_type_import_code(
void) {
22116 __Pyx_RefNannyDeclarations
22117 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22119 __Pyx_RefNannyFinishContext();
22123 static int __Pyx_modinit_variable_import_code(
void) {
22124 __Pyx_RefNannyDeclarations
22125 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22127 __Pyx_RefNannyFinishContext();
22131 static int __Pyx_modinit_function_import_code(
void) {
22132 __Pyx_RefNannyDeclarations
22133 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22135 __Pyx_RefNannyFinishContext();
22140 #ifndef CYTHON_NO_PYINIT_EXPORT
22141 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22142 #elif PY_MAJOR_VERSION < 3
22144 #define __Pyx_PyMODINIT_FUNC extern "C" void
22146 #define __Pyx_PyMODINIT_FUNC void
22150 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22152 #define __Pyx_PyMODINIT_FUNC PyObject *
22157 #if PY_MAJOR_VERSION < 3
22158 __Pyx_PyMODINIT_FUNC initpy_c_linear_operator(
void) CYTHON_SMALL_CODE;
22159 __Pyx_PyMODINIT_FUNC initpy_c_linear_operator(
void)
22161 __Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(
void) CYTHON_SMALL_CODE;
22162 __Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(
void)
22163 #if CYTHON_PEP489_MULTI_PHASE_INIT
22165 return PyModuleDef_Init(&__pyx_moduledef);
22167 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22168 #if PY_VERSION_HEX >= 0x030700A1
22169 static PY_INT64_T main_interpreter_id = -1;
22170 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22171 if (main_interpreter_id == -1) {
22172 main_interpreter_id = current_id;
22173 return (unlikely(current_id == -1)) ? -1 : 0;
22174 }
else if (unlikely(main_interpreter_id != current_id))
22176 static PyInterpreterState *main_interpreter = NULL;
22177 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22178 if (!main_interpreter) {
22179 main_interpreter = current_interpreter;
22180 }
else if (unlikely(main_interpreter != current_interpreter))
22185 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22190 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
22191 PyObject *value = PyObject_GetAttrString(spec, from_name);
22193 if (likely(value)) {
22194 if (allow_none || value != Py_None) {
22195 result = PyDict_SetItemString(moddict, to_name, value);
22198 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22205 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22206 PyObject *module = NULL, *moddict, *modname;
22207 if (__Pyx_check_single_interpreter())
22210 return __Pyx_NewRef(__pyx_m);
22211 modname = PyObject_GetAttrString(spec,
"name");
22212 if (unlikely(!modname))
goto bad;
22213 module = PyModule_NewObject(modname);
22214 Py_DECREF(modname);
22215 if (unlikely(!module))
goto bad;
22216 moddict = PyModule_GetDict(module);
22217 if (unlikely(!moddict))
goto bad;
22218 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
22219 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
22220 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
22221 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
22224 Py_XDECREF(module);
22229 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_py_c_linear_operator(PyObject *__pyx_pyinit_module)
22233 __Pyx_TraceDeclarations
22234 PyObject *__pyx_t_1 = NULL;
22235 static PyThread_type_lock __pyx_t_2[8];
22236 int __pyx_lineno = 0;
22237 const char *__pyx_filename = NULL;
22238 int __pyx_clineno = 0;
22239 __Pyx_RefNannyDeclarations
22240 #if CYTHON_PEP489_MULTI_PHASE_INIT
22242 if (__pyx_m == __pyx_pyinit_module)
return 0;
22243 PyErr_SetString(PyExc_RuntimeError,
"Module 'py_c_linear_operator' has already been imported. Re-initialisation is not supported.");
22246 #elif PY_MAJOR_VERSION >= 3
22247 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22249 #if CYTHON_REFNANNY
22250 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22251 if (!__Pyx_RefNanny) {
22253 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22254 if (!__Pyx_RefNanny)
22255 Py_FatalError(
"failed to import 'refnanny' module");
22258 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(void)", 0);
22259 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22260 #ifdef __Pxy_PyFrame_Initialize_Offsets
22261 __Pxy_PyFrame_Initialize_Offsets();
22263 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22264 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22265 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22266 #ifdef __Pyx_CyFunction_USED
22267 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22269 #ifdef __Pyx_FusedFunction_USED
22270 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22272 #ifdef __Pyx_Coroutine_USED
22273 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22275 #ifdef __Pyx_Generator_USED
22276 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22278 #ifdef __Pyx_AsyncGen_USED
22279 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22281 #ifdef __Pyx_StopAsyncIteration_USED
22282 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22286 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22287 PyEval_InitThreads();
22290 #if CYTHON_PEP489_MULTI_PHASE_INIT
22291 __pyx_m = __pyx_pyinit_module;
22292 Py_INCREF(__pyx_m);
22294 #if PY_MAJOR_VERSION < 3
22295 __pyx_m = Py_InitModule4(
"py_c_linear_operator", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22297 __pyx_m = PyModule_Create(&__pyx_moduledef);
22299 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22301 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22302 Py_INCREF(__pyx_d);
22303 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22304 Py_INCREF(__pyx_b);
22305 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22306 Py_INCREF(__pyx_cython_runtime);
22307 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22309 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22310 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22311 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22313 if (__pyx_module_is_main_imate___c_linear_operator__py_c_linear_operator) {
22314 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22316 #if PY_MAJOR_VERSION >= 3
22318 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22319 if (!PyDict_GetItemString(modules,
"imate._c_linear_operator.py_c_linear_operator")) {
22320 if (unlikely(PyDict_SetItemString(modules,
"imate._c_linear_operator.py_c_linear_operator", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22325 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22327 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22329 (void)__Pyx_modinit_global_init_code();
22330 (void)__Pyx_modinit_variable_export_code();
22331 (void)__Pyx_modinit_function_export_code();
22332 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22333 (void)__Pyx_modinit_type_import_code();
22334 (void)__Pyx_modinit_variable_import_code();
22335 (void)__Pyx_modinit_function_import_code();
22337 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22338 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22340 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
22349 __Pyx_TraceLine(14,0,__PYX_ERR(0, 14, __pyx_L1_error))
22350 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
22351 __Pyx_GOTREF(__pyx_t_1);
22352 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
22353 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22362 __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error))
22372 __Pyx_TraceLine(113,0,__PYX_ERR(0, 113, __pyx_L1_error))
22382 __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
22383 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_get_num_parame, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
22384 __Pyx_GOTREF(__pyx_t_1);
22385 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_get_num_parameters, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
22386 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22387 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22396 __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
22397 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_get_data_type, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
22398 __Pyx_GOTREF(__pyx_t_1);
22399 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_get_data_type_name, __pyx_t_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
22400 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22401 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22410 __Pyx_TraceLine(166,0,__PYX_ERR(0, 166, __pyx_L1_error))
22420 __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
22430 __Pyx_TraceLine(202,0,__PYX_ERR(0, 202, __pyx_L1_error))
22440 __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
22441 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_set_parameters, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
22442 __Pyx_GOTREF(__pyx_t_1);
22443 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_set_parameters, __pyx_t_1) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
22444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22445 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22454 __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error))
22456 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_dot, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
22457 __Pyx_GOTREF(__pyx_t_1);
22458 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_dot, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
22459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22460 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22469 __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
22471 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_transpose_dot, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__13));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
22472 __Pyx_GOTREF(__pyx_t_1);
22473 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_transpose_dot, __pyx_t_1) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
22474 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22475 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22482 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
22483 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator___reduce_cytho, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22484 __Pyx_GOTREF(__pyx_t_1);
22485 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22486 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22494 __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
22495 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator___setstate_cyt, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__16));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
22496 __Pyx_GOTREF(__pyx_t_1);
22497 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
22498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22505 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
22506 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22507 __Pyx_GOTREF(__pyx_t_1);
22508 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22509 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22518 __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
22519 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 210, __pyx_L1_error)
22520 __Pyx_GOTREF(__pyx_t_1);
22521 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
22522 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22523 PyType_Modified(__pyx_array_type);
22532 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
22542 __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
22552 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
22553 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
22554 __Pyx_GOTREF(__pyx_t_1);
22555 __Pyx_XGOTREF(
generic);
22556 __Pyx_DECREF_SET(
generic, __pyx_t_1);
22557 __Pyx_GIVEREF(__pyx_t_1);
22567 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
22568 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
22569 __Pyx_GOTREF(__pyx_t_1);
22570 __Pyx_XGOTREF(strided);
22571 __Pyx_DECREF_SET(strided, __pyx_t_1);
22572 __Pyx_GIVEREF(__pyx_t_1);
22582 __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
22583 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error)
22584 __Pyx_GOTREF(__pyx_t_1);
22585 __Pyx_XGOTREF(indirect);
22586 __Pyx_DECREF_SET(indirect, __pyx_t_1);
22587 __Pyx_GIVEREF(__pyx_t_1);
22597 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
22598 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
22599 __Pyx_GOTREF(__pyx_t_1);
22600 __Pyx_XGOTREF(contiguous);
22601 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
22602 __Pyx_GIVEREF(__pyx_t_1);
22612 __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
22613 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error)
22614 __Pyx_GOTREF(__pyx_t_1);
22615 __Pyx_XGOTREF(indirect_contiguous);
22616 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
22617 __Pyx_GIVEREF(__pyx_t_1);
22627 __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
22637 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
22638 __pyx_memoryview_thread_locks_used = 0;
22647 __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
22648 __pyx_t_2[0] = PyThread_allocate_lock();
22649 __pyx_t_2[1] = PyThread_allocate_lock();
22650 __pyx_t_2[2] = PyThread_allocate_lock();
22651 __pyx_t_2[3] = PyThread_allocate_lock();
22652 __pyx_t_2[4] = PyThread_allocate_lock();
22653 __pyx_t_2[5] = PyThread_allocate_lock();
22654 __pyx_t_2[6] = PyThread_allocate_lock();
22655 __pyx_t_2[7] = PyThread_allocate_lock();
22656 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
22665 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
22675 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
22685 __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
22695 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
22705 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
22715 __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
22725 __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
22735 __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
22736 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 551, __pyx_L1_error)
22737 __Pyx_GOTREF(__pyx_t_1);
22738 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
22739 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22740 PyType_Modified(__pyx_memoryview_type);
22749 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
22759 __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
22769 __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
22779 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
22789 __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
22799 __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
22809 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
22819 __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
22829 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
22839 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
22849 __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
22850 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 997, __pyx_L1_error)
22851 __Pyx_GOTREF(__pyx_t_1);
22852 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
22853 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22854 PyType_Modified(__pyx_memoryviewslice_type);
22863 __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
22873 __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
22883 __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
22893 __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
22903 __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
22913 __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
22923 __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
22933 __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
22943 __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
22953 __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
22963 __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
22973 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
22983 __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
22993 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
23003 __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
23013 __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
23023 __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
23033 __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
23043 __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
23053 __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
23063 __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
23071 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23072 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23073 __Pyx_GOTREF(__pyx_t_1);
23074 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23075 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23084 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
23086 __Pyx_TraceReturn(Py_None, 0);
23092 __Pyx_XDECREF(__pyx_t_1);
23095 __Pyx_AddTraceback(
"init imate._c_linear_operator.py_c_linear_operator", __pyx_clineno, __pyx_lineno, __pyx_filename);
23098 }
else if (!PyErr_Occurred()) {
23099 PyErr_SetString(PyExc_ImportError,
"init imate._c_linear_operator.py_c_linear_operator");
23102 __Pyx_RefNannyFinishContext();
23103 #if CYTHON_PEP489_MULTI_PHASE_INIT
23104 return (__pyx_m != NULL) ? 0 : -1;
23105 #elif PY_MAJOR_VERSION >= 3
23114 #if CYTHON_REFNANNY
23115 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23116 PyObject *m = NULL, *p = NULL;
23118 m = PyImport_ImportModule(modname);
23120 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23122 r = PyLong_AsVoidPtr(p);
23126 return (__Pyx_RefNannyAPIStruct *)r;
23131 #if CYTHON_USE_TYPE_SLOTS
23132 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23133 PyTypeObject* tp = Py_TYPE(obj);
23134 if (likely(tp->tp_getattro))
23135 return tp->tp_getattro(obj, attr_name);
23136 #if PY_MAJOR_VERSION < 3
23137 if (likely(tp->tp_getattr))
23138 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23140 return PyObject_GetAttr(obj, attr_name);
23145 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23146 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23147 if (unlikely(!result)) {
23148 PyErr_Format(PyExc_NameError,
23149 #
if PY_MAJOR_VERSION >= 3
23150 "name '%U' is not defined", name);
23152 "name '%.200s' is not defined", PyString_AS_STRING(name));
23159 static void __Pyx_RaiseArgtupleInvalid(
23160 const char* func_name,
23162 Py_ssize_t num_min,
23163 Py_ssize_t num_max,
23164 Py_ssize_t num_found)
23166 Py_ssize_t num_expected;
23167 const char *more_or_less;
23168 if (num_found < num_min) {
23169 num_expected = num_min;
23170 more_or_less =
"at least";
23172 num_expected = num_max;
23173 more_or_less =
"at most";
23176 more_or_less =
"exactly";
23178 PyErr_Format(PyExc_TypeError,
23179 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23180 func_name, more_or_less, num_expected,
23181 (num_expected == 1) ?
"" :
"s", num_found);
23185 static int __Pyx_CheckKeywordStrings(
23187 const char* function_name,
23191 Py_ssize_t pos = 0;
23192 #if CYTHON_COMPILING_IN_PYPY
23193 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
23194 goto invalid_keyword;
23197 while (PyDict_Next(kwdict, &pos, &key, 0)) {
23198 #if PY_MAJOR_VERSION < 3
23199 if (unlikely(!PyString_Check(key)))
23201 if (unlikely(!PyUnicode_Check(key)))
23202 goto invalid_keyword_type;
23204 if ((!kw_allowed) && unlikely(key))
23205 goto invalid_keyword;
23207 invalid_keyword_type:
23208 PyErr_Format(PyExc_TypeError,
23209 "%.200s() keywords must be strings", function_name);
23213 PyErr_Format(PyExc_TypeError,
23214 #
if PY_MAJOR_VERSION < 3
23215 "%.200s() got an unexpected keyword argument '%.200s'",
23216 function_name, PyString_AsString(key));
23218 "%s() got an unexpected keyword argument '%U'",
23219 function_name, key);
23225 #if CYTHON_FAST_THREAD_STATE
23226 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23227 PyObject *tmp_type, *tmp_value, *tmp_tb;
23228 tmp_type = tstate->curexc_type;
23229 tmp_value = tstate->curexc_value;
23230 tmp_tb = tstate->curexc_traceback;
23231 tstate->curexc_type = type;
23232 tstate->curexc_value = value;
23233 tstate->curexc_traceback = tb;
23234 Py_XDECREF(tmp_type);
23235 Py_XDECREF(tmp_value);
23236 Py_XDECREF(tmp_tb);
23238 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23239 *type = tstate->curexc_type;
23240 *value = tstate->curexc_value;
23241 *tb = tstate->curexc_traceback;
23242 tstate->curexc_type = 0;
23243 tstate->curexc_value = 0;
23244 tstate->curexc_traceback = 0;
23250 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
23251 PyFrameObject** frame,
23252 PyThreadState* tstate,
23253 const char *funcname,
23254 const char *srcfile,
23256 PyObject *type, *value, *traceback;
23258 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
23259 if (*code == NULL) {
23260 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
23261 if (*code == NULL)
return 0;
23263 *frame = PyFrame_New(
23269 if (*frame == NULL)
return 0;
23270 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
23271 Py_INCREF(Py_None);
23272 (*frame)->f_trace = Py_None;
23274 #if PY_VERSION_HEX < 0x030400B1
23276 (*frame)->f_tstate = tstate;
23279 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
23281 __Pyx_EnterTracing(tstate);
23282 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
23284 if (tstate->c_tracefunc)
23285 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
23286 if (retval && tstate->c_profilefunc)
23288 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
23289 __Pyx_LeaveTracing(tstate);
23291 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
23292 return __Pyx_IsTracing(tstate, 0, 0) && retval;
23296 Py_XDECREF(traceback);
23300 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
23301 PyCodeObject *py_code = 0;
23302 #if PY_MAJOR_VERSION >= 3
23303 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
23304 if (likely(py_code)) {
23305 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
23308 PyObject *py_srcfile = 0;
23309 PyObject *py_funcname = 0;
23310 py_funcname = PyString_FromString(funcname);
23311 if (unlikely(!py_funcname))
goto bad;
23312 py_srcfile = PyString_FromString(srcfile);
23313 if (unlikely(!py_srcfile))
goto bad;
23314 py_code = PyCode_New(
23318 CO_OPTIMIZED | CO_NEWLOCALS,
23331 Py_XDECREF(py_srcfile);
23332 Py_XDECREF(py_funcname);
23339 #if CYTHON_COMPILING_IN_CPYTHON
23340 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23342 ternaryfunc call = Py_TYPE(func)->tp_call;
23343 if (unlikely(!call))
23344 return PyObject_Call(func, arg, kw);
23345 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23347 result = (*call)(func, arg, kw);
23348 Py_LeaveRecursiveCall();
23349 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23352 "NULL result without error in PyObject_Call");
23359 #if PY_MAJOR_VERSION < 3
23360 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
23361 CYTHON_UNUSED PyObject *cause) {
23362 __Pyx_PyThreadState_declare
23364 if (!value || value == Py_None)
23368 if (!tb || tb == Py_None)
23372 if (!PyTraceBack_Check(tb)) {
23373 PyErr_SetString(PyExc_TypeError,
23374 "raise: arg 3 must be a traceback or None");
23378 if (PyType_Check(type)) {
23379 #if CYTHON_COMPILING_IN_PYPY
23381 Py_INCREF(Py_None);
23385 PyErr_NormalizeException(&type, &value, &tb);
23388 PyErr_SetString(PyExc_TypeError,
23389 "instance exception may not have a separate value");
23393 type = (PyObject*) Py_TYPE(type);
23395 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23396 PyErr_SetString(PyExc_TypeError,
23397 "raise: exception class must be a subclass of BaseException");
23401 __Pyx_PyThreadState_assign
23402 __Pyx_ErrRestore(type, value, tb);
23411 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23412 PyObject* owned_instance = NULL;
23413 if (tb == Py_None) {
23415 }
else if (tb && !PyTraceBack_Check(tb)) {
23416 PyErr_SetString(PyExc_TypeError,
23417 "raise: arg 3 must be a traceback or None");
23420 if (value == Py_None)
23422 if (PyExceptionInstance_Check(type)) {
23424 PyErr_SetString(PyExc_TypeError,
23425 "instance exception may not have a separate value");
23429 type = (PyObject*) Py_TYPE(value);
23430 }
else if (PyExceptionClass_Check(type)) {
23431 PyObject *instance_class = NULL;
23432 if (value && PyExceptionInstance_Check(value)) {
23433 instance_class = (PyObject*) Py_TYPE(value);
23434 if (instance_class != type) {
23435 int is_subclass = PyObject_IsSubclass(instance_class, type);
23436 if (!is_subclass) {
23437 instance_class = NULL;
23438 }
else if (unlikely(is_subclass == -1)) {
23441 type = instance_class;
23445 if (!instance_class) {
23448 args = PyTuple_New(0);
23449 else if (PyTuple_Check(value)) {
23453 args = PyTuple_Pack(1, value);
23456 owned_instance = PyObject_Call(type, args, NULL);
23458 if (!owned_instance)
23460 value = owned_instance;
23461 if (!PyExceptionInstance_Check(value)) {
23462 PyErr_Format(PyExc_TypeError,
23463 "calling %R should have returned an instance of "
23464 "BaseException, not %R",
23465 type, Py_TYPE(value));
23470 PyErr_SetString(PyExc_TypeError,
23471 "raise: exception class must be a subclass of BaseException");
23475 PyObject *fixed_cause;
23476 if (cause == Py_None) {
23477 fixed_cause = NULL;
23478 }
else if (PyExceptionClass_Check(cause)) {
23479 fixed_cause = PyObject_CallObject(cause, NULL);
23480 if (fixed_cause == NULL)
23482 }
else if (PyExceptionInstance_Check(cause)) {
23483 fixed_cause = cause;
23484 Py_INCREF(fixed_cause);
23486 PyErr_SetString(PyExc_TypeError,
23487 "exception causes must derive from "
23491 PyException_SetCause(value, fixed_cause);
23493 PyErr_SetObject(type, value);
23495 #if CYTHON_FAST_THREAD_STATE
23496 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23497 PyObject* tmp_tb = tstate->curexc_traceback;
23498 if (tb != tmp_tb) {
23500 tstate->curexc_traceback = tb;
23501 Py_XDECREF(tmp_tb);
23504 PyObject *tmp_type, *tmp_value, *tmp_tb;
23505 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
23507 PyErr_Restore(tmp_type, tmp_value, tb);
23508 Py_XDECREF(tmp_tb);
23512 Py_XDECREF(owned_instance);
23518 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
23519 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
23520 int full_traceback, CYTHON_UNUSED
int nogil) {
23521 PyObject *old_exc, *old_val, *old_tb;
23523 __Pyx_PyThreadState_declare
23525 PyGILState_STATE state;
23527 state = PyGILState_Ensure();
23528 else state = (PyGILState_STATE)0;
23530 __Pyx_PyThreadState_assign
23531 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
23532 if (full_traceback) {
23533 Py_XINCREF(old_exc);
23534 Py_XINCREF(old_val);
23535 Py_XINCREF(old_tb);
23536 __Pyx_ErrRestore(old_exc, old_val, old_tb);
23539 #if PY_MAJOR_VERSION < 3
23540 ctx = PyString_FromString(name);
23542 ctx = PyUnicode_FromString(name);
23544 __Pyx_ErrRestore(old_exc, old_val, old_tb);
23546 PyErr_WriteUnraisable(Py_None);
23548 PyErr_WriteUnraisable(ctx);
23553 PyGILState_Release(state);
23558 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
23559 #if CYTHON_COMPILING_IN_PYPY
23560 return PyObject_RichCompareBool(s1, s2, equals);
23563 return (equals == Py_EQ);
23564 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
23565 const char *ps1, *ps2;
23566 Py_ssize_t length = PyBytes_GET_SIZE(s1);
23567 if (length != PyBytes_GET_SIZE(s2))
23568 return (equals == Py_NE);
23569 ps1 = PyBytes_AS_STRING(s1);
23570 ps2 = PyBytes_AS_STRING(s2);
23571 if (ps1[0] != ps2[0]) {
23572 return (equals == Py_NE);
23573 }
else if (length == 1) {
23574 return (equals == Py_EQ);
23577 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
23578 Py_hash_t hash1, hash2;
23579 hash1 = ((PyBytesObject*)s1)->ob_shash;
23580 hash2 = ((PyBytesObject*)s2)->ob_shash;
23581 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23582 return (equals == Py_NE);
23585 result = memcmp(ps1, ps2, (
size_t)length);
23586 return (equals == Py_EQ) ? (result == 0) : (result != 0);
23588 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
23589 return (equals == Py_NE);
23590 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
23591 return (equals == Py_NE);
23594 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23597 result = __Pyx_PyObject_IsTrue(py_result);
23598 Py_DECREF(py_result);
23605 #if CYTHON_FAST_PYCCALL
23606 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23607 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23608 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23609 PyObject *
self = PyCFunction_GET_SELF(func);
23610 int flags = PyCFunction_GET_FLAGS(func);
23611 assert(PyCFunction_Check(func));
23612 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23613 assert(nargs >= 0);
23614 assert(nargs == 0 || args != NULL);
23618 assert(!PyErr_Occurred());
23619 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23620 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
23622 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
23628 #if CYTHON_FAST_PYCALL
23629 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23630 PyObject *globals) {
23632 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23633 PyObject **fastlocals;
23636 assert(globals != NULL);
23641 assert(tstate != NULL);
23642 f = PyFrame_New(tstate, co, globals, NULL);
23646 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23647 for (i = 0; i < na; i++) {
23649 fastlocals[i] = *args++;
23651 result = PyEval_EvalFrameEx(f,0);
23652 ++tstate->recursion_depth;
23654 --tstate->recursion_depth;
23657 #if 1 || PY_VERSION_HEX < 0x030600B1
23658 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23659 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23660 PyObject *globals = PyFunction_GET_GLOBALS(func);
23661 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23663 #if PY_MAJOR_VERSION >= 3
23666 PyObject *kwtuple, **k;
23671 assert(kwargs == NULL || PyDict_Check(kwargs));
23672 nk = kwargs ? PyDict_Size(kwargs) : 0;
23673 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
23677 #
if PY_MAJOR_VERSION >= 3
23678 co->co_kwonlyargcount == 0 &&
23680 likely(kwargs == NULL || nk == 0) &&
23681 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23682 if (argdefs == NULL && co->co_argcount == nargs) {
23683 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23686 else if (nargs == 0 && argdefs != NULL
23687 && co->co_argcount == Py_SIZE(argdefs)) {
23690 args = &PyTuple_GET_ITEM(argdefs, 0);
23691 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23695 if (kwargs != NULL) {
23697 kwtuple = PyTuple_New(2 * nk);
23698 if (kwtuple == NULL) {
23702 k = &PyTuple_GET_ITEM(kwtuple, 0);
23704 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23715 closure = PyFunction_GET_CLOSURE(func);
23716 #if PY_MAJOR_VERSION >= 3
23717 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23719 if (argdefs != NULL) {
23720 d = &PyTuple_GET_ITEM(argdefs, 0);
23721 nd = Py_SIZE(argdefs);
23727 #if PY_MAJOR_VERSION >= 3
23728 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23731 d, (
int)nd, kwdefs, closure);
23733 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23736 d, (
int)nd, closure);
23738 Py_XDECREF(kwtuple);
23740 Py_LeaveRecursiveCall();
23747 #if CYTHON_COMPILING_IN_CPYTHON
23748 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23749 PyObject *
self, *result;
23751 cfunc = PyCFunction_GET_FUNCTION(func);
23752 self = PyCFunction_GET_SELF(func);
23753 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23755 result = cfunc(
self, arg);
23756 Py_LeaveRecursiveCall();
23757 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23760 "NULL result without error in PyObject_Call");
23767 #if CYTHON_COMPILING_IN_CPYTHON
23768 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23770 PyObject *args = PyTuple_New(1);
23771 if (unlikely(!args))
return NULL;
23773 PyTuple_SET_ITEM(args, 0, arg);
23774 result = __Pyx_PyObject_Call(func, args, NULL);
23778 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23779 #if CYTHON_FAST_PYCALL
23780 if (PyFunction_Check(func)) {
23781 return __Pyx_PyFunction_FastCall(func, &arg, 1);
23784 if (likely(PyCFunction_Check(func))) {
23785 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23786 return __Pyx_PyObject_CallMethO(func, arg);
23787 #if CYTHON_FAST_PYCCALL
23788 }
else if (__Pyx_PyFastCFunction_Check(func)) {
23789 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23793 return __Pyx__PyObject_CallOneArg(func, arg);
23796 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23798 PyObject *args = PyTuple_Pack(1, arg);
23799 if (unlikely(!args))
return NULL;
23800 result = __Pyx_PyObject_Call(func, args, NULL);
23807 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
23808 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23809 PyObject *dict = Py_TYPE(obj)->tp_dict;
23810 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23812 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23813 PyObject **dictptr = NULL;
23814 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23816 #if CYTHON_COMPILING_IN_CPYTHON
23817 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
23819 dictptr = _PyObject_GetDictPtr(obj);
23822 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
23824 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
23825 PyObject *dict = Py_TYPE(obj)->tp_dict;
23826 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
23828 return obj_dict_version == __Pyx_get_object_dict_version(obj);
23833 #if CYTHON_USE_DICT_VERSIONS
23834 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
23836 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
23840 #if !CYTHON_AVOID_BORROWED_REFS
23841 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
23842 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
23843 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23844 if (likely(result)) {
23845 return __Pyx_NewRef(result);
23846 }
else if (unlikely(PyErr_Occurred())) {
23850 result = PyDict_GetItem(__pyx_d, name);
23851 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23852 if (likely(result)) {
23853 return __Pyx_NewRef(result);
23857 result = PyObject_GetItem(__pyx_d, name);
23858 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23859 if (likely(result)) {
23860 return __Pyx_NewRef(result);
23864 return __Pyx_GetBuiltinName(name);
23868 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
23869 PyObject *args, *result = NULL;
23870 #if CYTHON_FAST_PYCALL
23871 if (PyFunction_Check(
function)) {
23872 PyObject *args[2] = {arg1, arg2};
23873 return __Pyx_PyFunction_FastCall(
function, args, 2);
23876 #if CYTHON_FAST_PYCCALL
23877 if (__Pyx_PyFastCFunction_Check(
function)) {
23878 PyObject *args[2] = {arg1, arg2};
23879 return __Pyx_PyCFunction_FastCall(
function, args, 2);
23882 args = PyTuple_New(2);
23883 if (unlikely(!args))
goto done;
23885 PyTuple_SET_ITEM(args, 0, arg1);
23887 PyTuple_SET_ITEM(args, 1, arg2);
23888 Py_INCREF(
function);
23889 result = __Pyx_PyObject_Call(
function, args, NULL);
23891 Py_DECREF(
function);
23897 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
23898 #if CYTHON_COMPILING_IN_PYPY
23899 return PyObject_RichCompareBool(s1, s2, equals);
23901 #if PY_MAJOR_VERSION < 3
23902 PyObject* owned_ref = NULL;
23904 int s1_is_unicode, s2_is_unicode;
23908 s1_is_unicode = PyUnicode_CheckExact(s1);
23909 s2_is_unicode = PyUnicode_CheckExact(s2);
23910 #if PY_MAJOR_VERSION < 3
23911 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23912 owned_ref = PyUnicode_FromObject(s2);
23913 if (unlikely(!owned_ref))
23917 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23918 owned_ref = PyUnicode_FromObject(s1);
23919 if (unlikely(!owned_ref))
23923 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23924 return __Pyx_PyBytes_Equals(s1, s2, equals);
23927 if (s1_is_unicode & s2_is_unicode) {
23930 void *data1, *data2;
23931 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23933 length = __Pyx_PyUnicode_GET_LENGTH(s1);
23934 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23937 #if CYTHON_USE_UNICODE_INTERNALS
23939 Py_hash_t hash1, hash2;
23940 #if CYTHON_PEP393_ENABLED
23941 hash1 = ((PyASCIIObject*)s1)->hash;
23942 hash2 = ((PyASCIIObject*)s2)->hash;
23944 hash1 = ((PyUnicodeObject*)s1)->hash;
23945 hash2 = ((PyUnicodeObject*)s2)->hash;
23947 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23952 kind = __Pyx_PyUnicode_KIND(s1);
23953 if (kind != __Pyx_PyUnicode_KIND(s2)) {
23956 data1 = __Pyx_PyUnicode_DATA(s1);
23957 data2 = __Pyx_PyUnicode_DATA(s2);
23958 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23960 }
else if (length == 1) {
23963 int result = memcmp(data1, data2, (
size_t)(length * kind));
23964 #if PY_MAJOR_VERSION < 3
23965 Py_XDECREF(owned_ref);
23967 return (equals == Py_EQ) ? (result == 0) : (result != 0);
23969 }
else if ((s1 == Py_None) & s2_is_unicode) {
23971 }
else if ((s2 == Py_None) & s1_is_unicode) {
23975 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23976 #if PY_MAJOR_VERSION < 3
23977 Py_XDECREF(owned_ref);
23981 result = __Pyx_PyObject_IsTrue(py_result);
23982 Py_DECREF(py_result);
23986 #if PY_MAJOR_VERSION < 3
23987 Py_XDECREF(owned_ref);
23989 return (equals == Py_EQ);
23991 #if PY_MAJOR_VERSION < 3
23992 Py_XDECREF(owned_ref);
23994 return (equals == Py_NE);
24000 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24002 __Pyx_memviewslice *memviewslice,
24003 int memview_is_new_reference)
24005 __Pyx_RefNannyDeclarations
24007 Py_buffer *buf = &memview->view;
24008 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24009 if (unlikely(memviewslice->memview || memviewslice->data)) {
24010 PyErr_SetString(PyExc_ValueError,
24011 "memviewslice is already initialized!");
24014 if (buf->strides) {
24015 for (i = 0; i < ndim; i++) {
24016 memviewslice->strides[i] = buf->strides[i];
24019 Py_ssize_t stride = buf->itemsize;
24020 for (i = ndim - 1; i >= 0; i--) {
24021 memviewslice->strides[i] = stride;
24022 stride *= buf->shape[i];
24025 for (i = 0; i < ndim; i++) {
24026 memviewslice->shape[i] = buf->shape[i];
24027 if (buf->suboffsets) {
24028 memviewslice->suboffsets[i] = buf->suboffsets[i];
24030 memviewslice->suboffsets[i] = -1;
24033 memviewslice->memview = memview;
24034 memviewslice->data = (
char *)buf->buf;
24035 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24036 Py_INCREF(memview);
24041 memviewslice->memview = 0;
24042 memviewslice->data = 0;
24045 __Pyx_RefNannyFinishContext();
24048 #ifndef Py_NO_RETURN
24049 #define Py_NO_RETURN
24051 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24054 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
24055 va_start(vargs, fmt);
24059 vsnprintf(msg, 200, fmt, vargs);
24061 Py_FatalError(msg);
24063 static CYTHON_INLINE
int
24064 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24065 PyThread_type_lock lock)
24068 PyThread_acquire_lock(lock, 1);
24069 result = (*acquisition_count)++;
24070 PyThread_release_lock(lock);
24073 static CYTHON_INLINE
int
24074 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24075 PyThread_type_lock lock)
24078 PyThread_acquire_lock(lock, 1);
24079 result = (*acquisition_count)--;
24080 PyThread_release_lock(lock);
24083 static CYTHON_INLINE
void
24084 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24087 struct __pyx_memoryview_obj *memview = memslice->memview;
24088 if (unlikely(!memview || (PyObject *) memview == Py_None))
24090 if (unlikely(__pyx_get_slice_count(memview) < 0))
24091 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24092 __pyx_get_slice_count(memview), lineno);
24093 first_time = __pyx_add_acquisition_count(memview) == 0;
24094 if (unlikely(first_time)) {
24096 Py_INCREF((PyObject *) memview);
24098 PyGILState_STATE _gilstate = PyGILState_Ensure();
24099 Py_INCREF((PyObject *) memview);
24100 PyGILState_Release(_gilstate);
24104 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24105 int have_gil,
int lineno) {
24107 struct __pyx_memoryview_obj *memview = memslice->memview;
24108 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24109 memslice->memview = NULL;
24112 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24113 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24114 __pyx_get_slice_count(memview), lineno);
24115 last_time = __pyx_sub_acquisition_count(memview) == 1;
24116 memslice->data = NULL;
24117 if (unlikely(last_time)) {
24119 Py_CLEAR(memslice->memview);
24121 PyGILState_STATE _gilstate = PyGILState_Ensure();
24122 Py_CLEAR(memslice->memview);
24123 PyGILState_Release(_gilstate);
24126 memslice->memview = NULL;
24131 static void __Pyx_RaiseDoubleKeywordsError(
24132 const char* func_name,
24135 PyErr_Format(PyExc_TypeError,
24136 #
if PY_MAJOR_VERSION >= 3
24137 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24139 "%s() got multiple values for keyword argument '%s'", func_name,
24140 PyString_AsString(kw_name));
24145 static int __Pyx_ParseOptionalKeywords(
24147 PyObject **argnames[],
24149 PyObject *values[],
24150 Py_ssize_t num_pos_args,
24151 const char* function_name)
24153 PyObject *key = 0, *value = 0;
24154 Py_ssize_t pos = 0;
24156 PyObject*** first_kw_arg = argnames + num_pos_args;
24157 while (PyDict_Next(kwds, &pos, &key, &value)) {
24158 name = first_kw_arg;
24159 while (*name && (**name != key)) name++;
24161 values[name-argnames] = value;
24164 name = first_kw_arg;
24165 #if PY_MAJOR_VERSION < 3
24166 if (likely(PyString_Check(key))) {
24168 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24169 && _PyString_Eq(**name, key)) {
24170 values[name-argnames] = value;
24175 if (*name)
continue;
24177 PyObject*** argname = argnames;
24178 while (argname != first_kw_arg) {
24179 if ((**argname == key) || (
24180 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24181 && _PyString_Eq(**argname, key))) {
24182 goto arg_passed_twice;
24189 if (likely(PyUnicode_Check(key))) {
24191 int cmp = (**name == key) ? 0 :
24192 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24193 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24195 PyUnicode_Compare(**name, key);
24196 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24198 values[name-argnames] = value;
24203 if (*name)
continue;
24205 PyObject*** argname = argnames;
24206 while (argname != first_kw_arg) {
24207 int cmp = (**argname == key) ? 0 :
24208 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24209 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24211 PyUnicode_Compare(**argname, key);
24212 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24213 if (cmp == 0)
goto arg_passed_twice;
24218 goto invalid_keyword_type;
24220 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24222 goto invalid_keyword;
24227 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24229 invalid_keyword_type:
24230 PyErr_Format(PyExc_TypeError,
24231 "%.200s() keywords must be strings", function_name);
24234 PyErr_Format(PyExc_TypeError,
24235 #
if PY_MAJOR_VERSION < 3
24236 "%.200s() got an unexpected keyword argument '%.200s'",
24237 function_name, PyString_AsString(key));
24239 "%s() got an unexpected keyword argument '%U'",
24240 function_name, key);
24247 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24249 if (unlikely(!type)) {
24250 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24254 #if PY_MAJOR_VERSION == 2
24255 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24259 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24261 PyErr_Format(PyExc_TypeError,
24262 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24263 name, type->tp_name, Py_TYPE(obj)->tp_name);
24268 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24269 #if CYTHON_USE_TYPE_SLOTS
24270 #if PY_MAJOR_VERSION >= 3
24271 if (likely(PyUnicode_Check(n)))
24273 if (likely(PyString_Check(n)))
24275 return __Pyx_PyObject_GetAttrStr(o, n);
24277 return PyObject_GetAttr(o, n);
24281 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24283 if (!j)
return NULL;
24284 r = PyObject_GetItem(o, j);
24288 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24289 CYTHON_NCP_UNUSED
int wraparound,
24290 CYTHON_NCP_UNUSED
int boundscheck) {
24291 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24292 Py_ssize_t wrapped_i = i;
24293 if (wraparound & unlikely(i < 0)) {
24294 wrapped_i += PyList_GET_SIZE(o);
24296 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24297 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24301 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24303 return PySequence_GetItem(o, i);
24306 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24307 CYTHON_NCP_UNUSED
int wraparound,
24308 CYTHON_NCP_UNUSED
int boundscheck) {
24309 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24310 Py_ssize_t wrapped_i = i;
24311 if (wraparound & unlikely(i < 0)) {
24312 wrapped_i += PyTuple_GET_SIZE(o);
24314 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24315 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24319 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24321 return PySequence_GetItem(o, i);
24324 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24325 CYTHON_NCP_UNUSED
int wraparound,
24326 CYTHON_NCP_UNUSED
int boundscheck) {
24327 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24328 if (is_list || PyList_CheckExact(o)) {
24329 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24330 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24331 PyObject *r = PyList_GET_ITEM(o, n);
24336 else if (PyTuple_CheckExact(o)) {
24337 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24338 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24339 PyObject *r = PyTuple_GET_ITEM(o, n);
24344 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24345 if (likely(m && m->sq_item)) {
24346 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24347 Py_ssize_t l = m->sq_length(o);
24348 if (likely(l >= 0)) {
24351 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24356 return m->sq_item(o, i);
24360 if (is_list || PySequence_Check(o)) {
24361 return PySequence_GetItem(o, i);
24364 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24368 #if CYTHON_USE_TYPE_SLOTS
24369 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24370 PyObject *runerr = NULL;
24371 Py_ssize_t key_value;
24372 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24373 if (unlikely(!(m && m->sq_item))) {
24374 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24377 key_value = __Pyx_PyIndex_AsSsize_t(index);
24378 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24379 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24381 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24383 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24387 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24388 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24389 if (likely(m && m->mp_subscript)) {
24390 return m->mp_subscript(obj, key);
24392 return __Pyx_PyObject_GetIndex(obj, key);
24397 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24398 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24399 const char* encoding,
const char* errors,
24400 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
24402 if (unlikely((start < 0) | (stop < 0))) {
24403 size_t slen = strlen(cstring);
24404 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
24405 PyErr_SetString(PyExc_OverflowError,
24406 "c-string too long to convert to Python");
24409 length = (Py_ssize_t) slen;
24418 if (unlikely(stop <= start))
24419 return __Pyx_NewRef(__pyx_empty_unicode);
24420 length = stop - start;
24423 return decode_func(cstring, length, errors);
24425 return PyUnicode_Decode(cstring, length, encoding, errors);
24430 #if CYTHON_FAST_THREAD_STATE
24431 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24433 n = PyTuple_GET_SIZE(tuple);
24434 #if PY_MAJOR_VERSION >= 3
24435 for (i=0; i<n; i++) {
24436 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24439 for (i=0; i<n; i++) {
24440 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24444 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24445 PyObject *exc_type = tstate->curexc_type;
24446 if (exc_type == err)
return 1;
24447 if (unlikely(!exc_type))
return 0;
24448 if (unlikely(PyTuple_Check(err)))
24449 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24450 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24455 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24456 __Pyx_PyThreadState_declare
24457 __Pyx_PyThreadState_assign
24458 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24460 __Pyx_PyErr_Clear();
24464 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24465 PyObject *r = __Pyx_GetAttr(o, n);
24466 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24470 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24471 PyErr_Format(PyExc_ValueError,
24472 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24476 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24477 PyErr_Format(PyExc_ValueError,
24478 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24479 index, (index == 1) ?
"" :
"s");
24483 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
24484 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
24488 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24489 if (unlikely(!type)) {
24490 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24493 if (likely(__Pyx_TypeCheck(obj, type)))
24495 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
24496 Py_TYPE(obj)->tp_name, type->tp_name);
24501 #if CYTHON_USE_EXC_INFO_STACK
24502 static _PyErr_StackItem *
24503 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24505 _PyErr_StackItem *exc_info = tstate->exc_info;
24506 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24507 exc_info->previous_item != NULL)
24509 exc_info = exc_info->previous_item;
24516 #if CYTHON_FAST_THREAD_STATE
24517 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24518 #if CYTHON_USE_EXC_INFO_STACK
24519 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24520 *type = exc_info->exc_type;
24521 *value = exc_info->exc_value;
24522 *tb = exc_info->exc_traceback;
24524 *type = tstate->exc_type;
24525 *value = tstate->exc_value;
24526 *tb = tstate->exc_traceback;
24529 Py_XINCREF(*value);
24532 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24533 PyObject *tmp_type, *tmp_value, *tmp_tb;
24534 #if CYTHON_USE_EXC_INFO_STACK
24535 _PyErr_StackItem *exc_info = tstate->exc_info;
24536 tmp_type = exc_info->exc_type;
24537 tmp_value = exc_info->exc_value;
24538 tmp_tb = exc_info->exc_traceback;
24539 exc_info->exc_type = type;
24540 exc_info->exc_value = value;
24541 exc_info->exc_traceback = tb;
24543 tmp_type = tstate->exc_type;
24544 tmp_value = tstate->exc_value;
24545 tmp_tb = tstate->exc_traceback;
24546 tstate->exc_type = type;
24547 tstate->exc_value = value;
24548 tstate->exc_traceback = tb;
24550 Py_XDECREF(tmp_type);
24551 Py_XDECREF(tmp_value);
24552 Py_XDECREF(tmp_tb);
24557 #if CYTHON_FAST_THREAD_STATE
24558 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24560 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24563 PyObject *local_type, *local_value, *local_tb;
24564 #if CYTHON_FAST_THREAD_STATE
24565 PyObject *tmp_type, *tmp_value, *tmp_tb;
24566 local_type = tstate->curexc_type;
24567 local_value = tstate->curexc_value;
24568 local_tb = tstate->curexc_traceback;
24569 tstate->curexc_type = 0;
24570 tstate->curexc_value = 0;
24571 tstate->curexc_traceback = 0;
24573 PyErr_Fetch(&local_type, &local_value, &local_tb);
24575 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24576 #if CYTHON_FAST_THREAD_STATE
24577 if (unlikely(tstate->curexc_type))
24579 if (unlikely(PyErr_Occurred()))
24582 #if PY_MAJOR_VERSION >= 3
24584 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24588 Py_XINCREF(local_tb);
24589 Py_XINCREF(local_type);
24590 Py_XINCREF(local_value);
24591 *type = local_type;
24592 *value = local_value;
24594 #if CYTHON_FAST_THREAD_STATE
24595 #if CYTHON_USE_EXC_INFO_STACK
24597 _PyErr_StackItem *exc_info = tstate->exc_info;
24598 tmp_type = exc_info->exc_type;
24599 tmp_value = exc_info->exc_value;
24600 tmp_tb = exc_info->exc_traceback;
24601 exc_info->exc_type = local_type;
24602 exc_info->exc_value = local_value;
24603 exc_info->exc_traceback = local_tb;
24606 tmp_type = tstate->exc_type;
24607 tmp_value = tstate->exc_value;
24608 tmp_tb = tstate->exc_traceback;
24609 tstate->exc_type = local_type;
24610 tstate->exc_value = local_value;
24611 tstate->exc_traceback = local_tb;
24613 Py_XDECREF(tmp_type);
24614 Py_XDECREF(tmp_value);
24615 Py_XDECREF(tmp_tb);
24617 PyErr_SetExcInfo(local_type, local_value, local_tb);
24624 Py_XDECREF(local_type);
24625 Py_XDECREF(local_value);
24626 Py_XDECREF(local_tb);
24631 #if CYTHON_FAST_THREAD_STATE
24632 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24633 PyObject *tmp_type, *tmp_value, *tmp_tb;
24634 #if CYTHON_USE_EXC_INFO_STACK
24635 _PyErr_StackItem *exc_info = tstate->exc_info;
24636 tmp_type = exc_info->exc_type;
24637 tmp_value = exc_info->exc_value;
24638 tmp_tb = exc_info->exc_traceback;
24639 exc_info->exc_type = *type;
24640 exc_info->exc_value = *value;
24641 exc_info->exc_traceback = *tb;
24643 tmp_type = tstate->exc_type;
24644 tmp_value = tstate->exc_value;
24645 tmp_tb = tstate->exc_traceback;
24646 tstate->exc_type = *type;
24647 tstate->exc_value = *value;
24648 tstate->exc_traceback = *tb;
24651 *value = tmp_value;
24655 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
24656 PyObject *tmp_type, *tmp_value, *tmp_tb;
24657 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
24658 PyErr_SetExcInfo(*type, *value, *tb);
24660 *value = tmp_value;
24666 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
24667 PyObject *empty_list = 0;
24668 PyObject *module = 0;
24669 PyObject *global_dict = 0;
24670 PyObject *empty_dict = 0;
24672 #if PY_MAJOR_VERSION < 3
24673 PyObject *py_import;
24674 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24681 empty_list = PyList_New(0);
24686 global_dict = PyModule_GetDict(__pyx_m);
24689 empty_dict = PyDict_New();
24693 #if PY_MAJOR_VERSION >= 3
24695 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
24696 module = PyImport_ImportModuleLevelObject(
24697 name, global_dict, empty_dict, list, 1);
24699 if (!PyErr_ExceptionMatches(PyExc_ImportError))
24708 #if PY_MAJOR_VERSION < 3
24709 PyObject *py_level = PyInt_FromLong(level);
24712 module = PyObject_CallFunctionObjArgs(py_import,
24713 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24714 Py_DECREF(py_level);
24716 module = PyImport_ImportModuleLevelObject(
24717 name, global_dict, empty_dict, list, level);
24722 #if PY_MAJOR_VERSION < 3
24723 Py_XDECREF(py_import);
24725 Py_XDECREF(empty_list);
24726 Py_XDECREF(empty_dict);
24731 #if CYTHON_COMPILING_IN_CPYTHON
24732 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24738 return b == &PyBaseObject_Type;
24740 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24742 if (a == b)
return 1;
24746 n = PyTuple_GET_SIZE(mro);
24747 for (i = 0; i < n; i++) {
24748 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24753 return __Pyx_InBases(a, b);
24755 #if PY_MAJOR_VERSION == 2
24756 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24757 PyObject *exception, *value, *tb;
24759 __Pyx_PyThreadState_declare
24760 __Pyx_PyThreadState_assign
24761 __Pyx_ErrFetch(&exception, &value, &tb);
24762 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24763 if (unlikely(res == -1)) {
24764 PyErr_WriteUnraisable(err);
24768 res = PyObject_IsSubclass(err, exc_type2);
24769 if (unlikely(res == -1)) {
24770 PyErr_WriteUnraisable(err);
24774 __Pyx_ErrRestore(exception, value, tb);
24778 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24779 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24781 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24786 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24788 assert(PyExceptionClass_Check(exc_type));
24789 n = PyTuple_GET_SIZE(tuple);
24790 #if PY_MAJOR_VERSION >= 3
24791 for (i=0; i<n; i++) {
24792 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24795 for (i=0; i<n; i++) {
24796 PyObject *t = PyTuple_GET_ITEM(tuple, i);
24797 #if PY_MAJOR_VERSION < 3
24798 if (likely(exc_type == t))
return 1;
24800 if (likely(PyExceptionClass_Check(t))) {
24801 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
24807 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24808 if (likely(err == exc_type))
return 1;
24809 if (likely(PyExceptionClass_Check(err))) {
24810 if (likely(PyExceptionClass_Check(exc_type))) {
24811 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24812 }
else if (likely(PyTuple_Check(exc_type))) {
24813 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24817 return PyErr_GivenExceptionMatches(err, exc_type);
24819 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24820 assert(PyExceptionClass_Check(exc_type1));
24821 assert(PyExceptionClass_Check(exc_type2));
24822 if (likely(err == exc_type1 || err == exc_type2))
return 1;
24823 if (likely(PyExceptionClass_Check(err))) {
24824 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24826 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24831 #if !CYTHON_COMPILING_IN_PYPY
24832 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
24834 (void)zerodivision_check;
24835 #if PY_MAJOR_VERSION < 3
24836 if (likely(PyInt_CheckExact(op1))) {
24837 const long b = intval;
24839 long a = PyInt_AS_LONG(op1);
24840 x = (long)((
unsigned long)a + b);
24841 if (likely((x^a) >= 0 || (x^b) >= 0))
24842 return PyInt_FromLong(x);
24843 return PyLong_Type.tp_as_number->nb_add(op1, op2);
24846 #if CYTHON_USE_PYLONG_INTERNALS
24847 if (likely(PyLong_CheckExact(op1))) {
24848 const long b = intval;
24850 #ifdef HAVE_LONG_LONG
24851 const PY_LONG_LONG llb = intval;
24852 PY_LONG_LONG lla, llx;
24854 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24855 const Py_ssize_t size = Py_SIZE(op1);
24856 if (likely(__Pyx_sst_abs(size) <= 1)) {
24857 a = likely(size) ? digits[0] : 0;
24858 if (size == -1) a = -a;
24862 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24863 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24865 #ifdef HAVE_LONG_LONG
24866 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24867 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24871 CYTHON_FALLTHROUGH;
24873 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24874 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24876 #ifdef HAVE_LONG_LONG
24877 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24878 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24882 CYTHON_FALLTHROUGH;
24884 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24885 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24887 #ifdef HAVE_LONG_LONG
24888 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24889 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24893 CYTHON_FALLTHROUGH;
24895 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24896 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24898 #ifdef HAVE_LONG_LONG
24899 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24900 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24904 CYTHON_FALLTHROUGH;
24906 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24907 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24909 #ifdef HAVE_LONG_LONG
24910 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24911 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24915 CYTHON_FALLTHROUGH;
24917 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24918 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24920 #ifdef HAVE_LONG_LONG
24921 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24922 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24926 CYTHON_FALLTHROUGH;
24927 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
24931 return PyLong_FromLong(x);
24932 #ifdef HAVE_LONG_LONG
24935 return PyLong_FromLongLong(llx);
24941 if (PyFloat_CheckExact(op1)) {
24942 const long b = intval;
24943 double a = PyFloat_AS_DOUBLE(op1);
24945 PyFPE_START_PROTECT(
"add",
return NULL)
24946 result = ((double)a) + (double)b;
24947 PyFPE_END_PROTECT(result)
24948 return PyFloat_FromDouble(result);
24950 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24955 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
24956 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
24960 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24961 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24962 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24963 PyErr_Format(PyExc_ImportError,
24964 #
if PY_MAJOR_VERSION < 3
24965 "cannot import name %.230s", PyString_AS_STRING(name));
24967 "cannot import name %S", name);
24974 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
24976 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
24977 PyErr_SetString(PyExc_TypeError,
24978 "hasattr(): attribute name must be string");
24981 r = __Pyx_GetAttr(o, n);
24982 if (unlikely(!r)) {
24992 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24993 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
24994 PyErr_Format(PyExc_AttributeError,
24995 #
if PY_MAJOR_VERSION >= 3
24996 "'%.50s' object has no attribute '%U'",
24997 tp->tp_name, attr_name);
24999 "'%.50s' object has no attribute '%.400s'",
25000 tp->tp_name, PyString_AS_STRING(attr_name));
25004 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25006 PyTypeObject *tp = Py_TYPE(obj);
25007 if (unlikely(!PyString_Check(attr_name))) {
25008 return PyObject_GenericGetAttr(obj, attr_name);
25010 assert(!tp->tp_dictoffset);
25011 descr = _PyType_Lookup(tp, attr_name);
25012 if (unlikely(!descr)) {
25013 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25016 #if PY_MAJOR_VERSION < 3
25017 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25020 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25022 PyObject *res = f(descr, obj, (PyObject *)tp);
25032 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25033 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25034 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25035 return PyObject_GenericGetAttr(obj, attr_name);
25037 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25042 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
25043 #if PY_VERSION_HEX >= 0x02070000
25044 PyObject *ob = PyCapsule_New(vtable, 0, 0);
25046 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25050 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25060 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
25061 __Pyx_PyThreadState_declare
25062 __Pyx_PyThreadState_assign
25063 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25064 __Pyx_PyErr_Clear();
25066 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25068 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25069 PyTypeObject* tp = Py_TYPE(obj);
25070 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25071 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25074 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25075 if (unlikely(!result)) {
25076 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25082 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25084 PyObject *name_attr;
25085 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25086 if (likely(name_attr)) {
25087 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25091 if (unlikely(ret < 0)) {
25095 Py_XDECREF(name_attr);
25098 static int __Pyx_setup_reduce(PyObject* type_obj) {
25100 PyObject *object_reduce = NULL;
25101 PyObject *object_getstate = NULL;
25102 PyObject *object_reduce_ex = NULL;
25103 PyObject *reduce = NULL;
25104 PyObject *reduce_ex = NULL;
25105 PyObject *reduce_cython = NULL;
25106 PyObject *setstate = NULL;
25107 PyObject *setstate_cython = NULL;
25108 PyObject *getstate = NULL;
25109 #if CYTHON_USE_PYTYPE_LOOKUP
25110 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
25112 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
25113 if (!getstate && PyErr_Occurred()) {
25118 #if CYTHON_USE_PYTYPE_LOOKUP
25119 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
25121 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
25122 if (!object_getstate && PyErr_Occurred()) {
25126 if (object_getstate != getstate) {
25130 #if CYTHON_USE_PYTYPE_LOOKUP
25131 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25133 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25135 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
25136 if (reduce_ex == object_reduce_ex) {
25137 #if CYTHON_USE_PYTYPE_LOOKUP
25138 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25140 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25142 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
25143 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25144 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25145 if (likely(reduce_cython)) {
25146 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25147 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25148 }
else if (reduce == object_reduce || PyErr_Occurred()) {
25151 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25152 if (!setstate) PyErr_Clear();
25153 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25154 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25155 if (likely(setstate_cython)) {
25156 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25157 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25158 }
else if (!setstate || PyErr_Occurred()) {
25162 PyType_Modified((PyTypeObject*)type_obj);
25167 if (!PyErr_Occurred())
25168 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25171 #if !CYTHON_USE_PYTYPE_LOOKUP
25172 Py_XDECREF(object_reduce);
25173 Py_XDECREF(object_reduce_ex);
25174 Py_XDECREF(object_getstate);
25175 Py_XDECREF(getstate);
25177 Py_XDECREF(reduce);
25178 Py_XDECREF(reduce_ex);
25179 Py_XDECREF(reduce_cython);
25180 Py_XDECREF(setstate);
25181 Py_XDECREF(setstate_cython);
25186 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25187 PyObject* fake_module;
25188 PyTypeObject* cached_type = NULL;
25189 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25190 if (!fake_module)
return NULL;
25191 Py_INCREF(fake_module);
25192 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25194 if (!PyType_Check((PyObject*)cached_type)) {
25195 PyErr_Format(PyExc_TypeError,
25196 "Shared Cython type %.200s is not a type object",
25200 if (cached_type->tp_basicsize != type->tp_basicsize) {
25201 PyErr_Format(PyExc_TypeError,
25202 "Shared Cython type %.200s has the wrong size, try recompiling",
25207 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25209 if (PyType_Ready(type) < 0)
goto bad;
25210 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25213 cached_type = type;
25216 Py_DECREF(fake_module);
25217 return cached_type;
25219 Py_XDECREF(cached_type);
25220 cached_type = NULL;
25225 #include <structmember.h>
25227 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25229 if (unlikely(op->func_doc == NULL)) {
25230 if (op->func.m_ml->ml_doc) {
25231 #if PY_MAJOR_VERSION >= 3
25232 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25234 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25236 if (unlikely(op->func_doc == NULL))
25239 Py_INCREF(Py_None);
25243 Py_INCREF(op->func_doc);
25244 return op->func_doc;
25247 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25249 PyObject *tmp = op->func_doc;
25250 if (value == NULL) {
25254 op->func_doc = value;
25259 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25261 if (unlikely(op->func_name == NULL)) {
25262 #if PY_MAJOR_VERSION >= 3
25263 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25265 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25267 if (unlikely(op->func_name == NULL))
25270 Py_INCREF(op->func_name);
25271 return op->func_name;
25274 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25277 #if PY_MAJOR_VERSION >= 3
25278 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25280 if (unlikely(value == NULL || !PyString_Check(value)))
25283 PyErr_SetString(PyExc_TypeError,
25284 "__name__ must be set to a string object");
25287 tmp = op->func_name;
25289 op->func_name = value;
25294 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25296 Py_INCREF(op->func_qualname);
25297 return op->func_qualname;
25300 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25303 #if PY_MAJOR_VERSION >= 3
25304 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25306 if (unlikely(value == NULL || !PyString_Check(value)))
25309 PyErr_SetString(PyExc_TypeError,
25310 "__qualname__ must be set to a string object");
25313 tmp = op->func_qualname;
25315 op->func_qualname = value;
25320 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25323 self = m->func_closure;
25330 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25332 if (unlikely(op->func_dict == NULL)) {
25333 op->func_dict = PyDict_New();
25334 if (unlikely(op->func_dict == NULL))
25337 Py_INCREF(op->func_dict);
25338 return op->func_dict;
25341 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25344 if (unlikely(value == NULL)) {
25345 PyErr_SetString(PyExc_TypeError,
25346 "function's dictionary may not be deleted");
25349 if (unlikely(!PyDict_Check(value))) {
25350 PyErr_SetString(PyExc_TypeError,
25351 "setting function's dictionary to a non-dict");
25354 tmp = op->func_dict;
25356 op->func_dict = value;
25361 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25363 Py_INCREF(op->func_globals);
25364 return op->func_globals;
25367 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25369 Py_INCREF(Py_None);
25373 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25375 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25380 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25382 PyObject *res = op->defaults_getter((PyObject *) op);
25383 if (unlikely(!res))
25385 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25386 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25387 Py_INCREF(op->defaults_tuple);
25388 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25389 Py_INCREF(op->defaults_kwdict);
25391 op->defaults_tuple = PySequence_ITEM(res, 0);
25392 if (unlikely(!op->defaults_tuple)) result = -1;
25394 op->defaults_kwdict = PySequence_ITEM(res, 1);
25395 if (unlikely(!op->defaults_kwdict)) result = -1;
25402 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25406 }
else if (value != Py_None && !PyTuple_Check(value)) {
25407 PyErr_SetString(PyExc_TypeError,
25408 "__defaults__ must be set to a tuple object");
25412 tmp = op->defaults_tuple;
25413 op->defaults_tuple = value;
25418 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25419 PyObject* result = op->defaults_tuple;
25420 if (unlikely(!result)) {
25421 if (op->defaults_getter) {
25422 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25423 result = op->defaults_tuple;
25432 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25436 }
else if (value != Py_None && !PyDict_Check(value)) {
25437 PyErr_SetString(PyExc_TypeError,
25438 "__kwdefaults__ must be set to a dict object");
25442 tmp = op->defaults_kwdict;
25443 op->defaults_kwdict = value;
25448 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25449 PyObject* result = op->defaults_kwdict;
25450 if (unlikely(!result)) {
25451 if (op->defaults_getter) {
25452 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25453 result = op->defaults_kwdict;
25462 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25464 if (!value || value == Py_None) {
25466 }
else if (!PyDict_Check(value)) {
25467 PyErr_SetString(PyExc_TypeError,
25468 "__annotations__ must be set to a dict object");
25472 tmp = op->func_annotations;
25473 op->func_annotations = value;
25478 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25479 PyObject* result = op->func_annotations;
25480 if (unlikely(!result)) {
25481 result = PyDict_New();
25482 if (unlikely(!result))
return NULL;
25483 op->func_annotations = result;
25488 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25489 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25490 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25491 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25492 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25493 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25494 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25495 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25496 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25497 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25498 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25499 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25500 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25501 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25502 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25503 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25504 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25505 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25506 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25509 static PyMemberDef __pyx_CyFunction_members[] = {
25510 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25514 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25516 #if PY_MAJOR_VERSION >= 3
25517 Py_INCREF(m->func_qualname);
25518 return m->func_qualname;
25520 return PyString_FromString(m->func.m_ml->ml_name);
25523 static PyMethodDef __pyx_CyFunction_methods[] = {
25524 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25527 #if PY_VERSION_HEX < 0x030500A0
25528 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25530 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25532 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
25533 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25534 if (unlikely(op == NULL))
25537 __Pyx_CyFunction_weakreflist(op) = NULL;
25538 op->func.m_ml = ml;
25539 op->func.m_self = (PyObject *) op;
25540 Py_XINCREF(closure);
25541 op->func_closure = closure;
25542 Py_XINCREF(module);
25543 op->func.m_module = module;
25544 op->func_dict = NULL;
25545 op->func_name = NULL;
25546 Py_INCREF(qualname);
25547 op->func_qualname = qualname;
25548 op->func_doc = NULL;
25549 op->func_classobj = NULL;
25550 op->func_globals = globals;
25551 Py_INCREF(op->func_globals);
25553 op->func_code = code;
25554 op->defaults_pyobjects = 0;
25555 op->defaults_size = 0;
25556 op->defaults = NULL;
25557 op->defaults_tuple = NULL;
25558 op->defaults_kwdict = NULL;
25559 op->defaults_getter = NULL;
25560 op->func_annotations = NULL;
25561 return (PyObject *) op;
25564 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25566 Py_CLEAR(m->func_closure);
25567 Py_CLEAR(m->func.m_module);
25568 Py_CLEAR(m->func_dict);
25569 Py_CLEAR(m->func_name);
25570 Py_CLEAR(m->func_qualname);
25571 Py_CLEAR(m->func_doc);
25572 Py_CLEAR(m->func_globals);
25573 Py_CLEAR(m->func_code);
25574 Py_CLEAR(m->func_classobj);
25575 Py_CLEAR(m->defaults_tuple);
25576 Py_CLEAR(m->defaults_kwdict);
25577 Py_CLEAR(m->func_annotations);
25579 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25581 for (i = 0; i < m->defaults_pyobjects; i++)
25582 Py_XDECREF(pydefaults[i]);
25583 PyObject_Free(m->defaults);
25584 m->defaults = NULL;
25588 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25590 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25591 PyObject_ClearWeakRefs((PyObject *) m);
25592 __Pyx_CyFunction_clear(m);
25593 PyObject_GC_Del(m);
25595 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25597 PyObject_GC_UnTrack(m);
25598 __Pyx__CyFunction_dealloc(m);
25600 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
25602 Py_VISIT(m->func_closure);
25603 Py_VISIT(m->func.m_module);
25604 Py_VISIT(m->func_dict);
25605 Py_VISIT(m->func_name);
25606 Py_VISIT(m->func_qualname);
25607 Py_VISIT(m->func_doc);
25608 Py_VISIT(m->func_globals);
25609 Py_VISIT(m->func_code);
25610 Py_VISIT(m->func_classobj);
25611 Py_VISIT(m->defaults_tuple);
25612 Py_VISIT(m->defaults_kwdict);
25614 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25616 for (i = 0; i < m->defaults_pyobjects; i++)
25617 Py_VISIT(pydefaults[i]);
25621 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25623 #if PY_MAJOR_VERSION < 3
25624 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25625 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25629 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25631 type = (PyObject *)(Py_TYPE(obj));
25632 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25634 if (obj == Py_None)
25637 return __Pyx_PyMethod_New(func, obj, type);
25640 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25642 #if PY_MAJOR_VERSION >= 3
25643 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
25644 op->func_qualname, (
void *)op);
25646 return PyString_FromFormat(
"<cyfunction %s at %p>",
25647 PyString_AsString(op->func_qualname), (
void *)op);
25650 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
25651 PyCFunctionObject* f = (PyCFunctionObject*)func;
25652 PyCFunction meth = f->m_ml->ml_meth;
25654 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25656 if (likely(kw == NULL || PyDict_Size(kw) == 0))
25657 return (*meth)(
self, arg);
25659 case METH_VARARGS | METH_KEYWORDS:
25660 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
25662 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25663 size = PyTuple_GET_SIZE(arg);
25664 if (likely(size == 0))
25665 return (*meth)(
self, NULL);
25666 PyErr_Format(PyExc_TypeError,
25667 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25668 f->m_ml->ml_name, size);
25673 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25674 size = PyTuple_GET_SIZE(arg);
25675 if (likely(size == 1)) {
25676 PyObject *result, *arg0;
25677 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25678 arg0 = PyTuple_GET_ITEM(arg, 0);
25680 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
25682 result = (*meth)(
self, arg0);
25683 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25688 PyErr_Format(PyExc_TypeError,
25689 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25690 f->m_ml->ml_name, size);
25695 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
25696 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25697 "longer supported!");
25700 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
25704 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25705 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25707 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25709 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25710 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25712 PyObject *new_args;
25714 argc = PyTuple_GET_SIZE(args);
25715 new_args = PyTuple_GetSlice(args, 1, argc);
25716 if (unlikely(!new_args))
25718 self = PyTuple_GetItem(args, 0);
25719 if (unlikely(!
self)) {
25720 Py_DECREF(new_args);
25721 #if PY_MAJOR_VERSION > 2
25722 PyErr_Format(PyExc_TypeError,
25723 "unbound method %.200S() needs an argument",
25724 cyfunc->func_qualname);
25726 PyErr_SetString(PyExc_TypeError,
25727 "unbound method needs an argument");
25731 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
25732 Py_DECREF(new_args);
25734 result = __Pyx_CyFunction_Call(func, args, kw);
25738 static PyTypeObject __pyx_CyFunctionType_type = {
25739 PyVarObject_HEAD_INIT(0, 0)
25740 "cython_function_or_method",
25741 sizeof(__pyx_CyFunctionObject),
25743 (destructor) __Pyx_CyFunction_dealloc,
25747 #if PY_MAJOR_VERSION < 3
25752 (reprfunc) __Pyx_CyFunction_repr,
25757 __Pyx_CyFunction_CallAsMethod,
25762 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25764 (traverseproc) __Pyx_CyFunction_traverse,
25765 (inquiry) __Pyx_CyFunction_clear,
25767 #
if PY_VERSION_HEX < 0x030500A0
25768 offsetof(__pyx_CyFunctionObject, func_weakreflist),
25770 offsetof(PyCFunctionObject, m_weakreflist),
25774 __pyx_CyFunction_methods,
25775 __pyx_CyFunction_members,
25776 __pyx_CyFunction_getsets,
25779 __Pyx_CyFunction_descr_get,
25781 offsetof(__pyx_CyFunctionObject, func_dict),
25794 #if PY_VERSION_HEX >= 0x030400a1
25797 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25800 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25803 #if PY_VERSION_HEX >= 0x030C0000
25806 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25810 static int __pyx_CyFunction_init(
void) {
25811 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25812 if (unlikely(__pyx_CyFunctionType == NULL)) {
25817 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
25818 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25819 m->defaults = PyObject_Malloc(size);
25820 if (unlikely(!m->defaults))
25821 return PyErr_NoMemory();
25822 memset(m->defaults, 0, size);
25823 m->defaults_pyobjects = pyobjects;
25824 m->defaults_size = size;
25825 return m->defaults;
25827 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25828 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25829 m->defaults_tuple = tuple;
25832 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25833 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25834 m->defaults_kwdict = dict;
25837 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25838 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25839 m->func_annotations = dict;
25844 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
25845 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25846 PyObject *op = __Pyx_CyFunction_Init(
25847 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25848 ml, flags, qualname, closure, module, globals, code
25851 PyObject_GC_Track(op);
25857 #ifndef CYTHON_CLINE_IN_TRACEBACK
25858 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
25859 PyObject *use_cline;
25860 PyObject *ptype, *pvalue, *ptraceback;
25861 #if CYTHON_COMPILING_IN_CPYTHON
25862 PyObject **cython_runtime_dict;
25864 if (unlikely(!__pyx_cython_runtime)) {
25867 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25868 #if CYTHON_COMPILING_IN_CPYTHON
25869 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25870 if (likely(cython_runtime_dict)) {
25871 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25872 use_cline, *cython_runtime_dict,
25873 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25877 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25878 if (use_cline_obj) {
25879 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25880 Py_DECREF(use_cline_obj);
25888 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25890 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25893 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25899 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25900 int start = 0, mid = 0, end = count - 1;
25901 if (end >= 0 && code_line > entries[end].code_line) {
25904 while (start < end) {
25905 mid = start + (end - start) / 2;
25906 if (code_line < entries[mid].code_line) {
25908 }
else if (code_line > entries[mid].code_line) {
25914 if (code_line <= entries[mid].code_line) {
25920 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25921 PyCodeObject* code_object;
25923 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25926 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25927 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25930 code_object = __pyx_code_cache.entries[pos].code_object;
25931 Py_INCREF(code_object);
25932 return code_object;
25934 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25936 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25937 if (unlikely(!code_line)) {
25940 if (unlikely(!entries)) {
25941 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25942 if (likely(entries)) {
25943 __pyx_code_cache.entries = entries;
25944 __pyx_code_cache.max_count = 64;
25945 __pyx_code_cache.count = 1;
25946 entries[0].code_line = code_line;
25947 entries[0].code_object = code_object;
25948 Py_INCREF(code_object);
25952 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25953 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25954 PyCodeObject* tmp = entries[pos].code_object;
25955 entries[pos].code_object = code_object;
25959 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25960 int new_max = __pyx_code_cache.max_count + 64;
25961 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25962 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
25963 if (unlikely(!entries)) {
25966 __pyx_code_cache.entries = entries;
25967 __pyx_code_cache.max_count = new_max;
25969 for (i=__pyx_code_cache.count; i>pos; i--) {
25970 entries[i] = entries[i-1];
25972 entries[pos].code_line = code_line;
25973 entries[pos].code_object = code_object;
25974 __pyx_code_cache.count++;
25975 Py_INCREF(code_object);
25979 #include "compile.h"
25980 #include "frameobject.h"
25981 #include "traceback.h"
25982 #if PY_VERSION_HEX >= 0x030b00a6
25983 #ifndef Py_BUILD_CORE
25984 #define Py_BUILD_CORE 1
25986 #include "internal/pycore_frame.h"
25988 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25989 const char *funcname,
int c_line,
25990 int py_line,
const char *filename) {
25991 PyCodeObject *py_code = NULL;
25992 PyObject *py_funcname = NULL;
25993 #if PY_MAJOR_VERSION < 3
25994 PyObject *py_srcfile = NULL;
25995 py_srcfile = PyString_FromString(filename);
25996 if (!py_srcfile)
goto bad;
25999 #if PY_MAJOR_VERSION < 3
26000 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26001 if (!py_funcname)
goto bad;
26003 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26004 if (!py_funcname)
goto bad;
26005 funcname = PyUnicode_AsUTF8(py_funcname);
26006 if (!funcname)
goto bad;
26010 #if PY_MAJOR_VERSION < 3
26011 py_funcname = PyString_FromString(funcname);
26012 if (!py_funcname)
goto bad;
26015 #if PY_MAJOR_VERSION < 3
26016 py_code = __Pyx_PyCode_New(
26033 Py_DECREF(py_srcfile);
26035 py_code = PyCode_NewEmpty(filename, funcname, py_line);
26037 Py_XDECREF(py_funcname);
26040 Py_XDECREF(py_funcname);
26041 #if PY_MAJOR_VERSION < 3
26042 Py_XDECREF(py_srcfile);
26046 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26047 int py_line,
const char *filename) {
26048 PyCodeObject *py_code = 0;
26049 PyFrameObject *py_frame = 0;
26050 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26051 PyObject *ptype, *pvalue, *ptraceback;
26053 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26055 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26057 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26058 py_code = __Pyx_CreateCodeObjectForTraceback(
26059 funcname, c_line, py_line, filename);
26064 Py_XDECREF(pvalue);
26065 Py_XDECREF(ptraceback);
26068 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26069 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26071 py_frame = PyFrame_New(
26077 if (!py_frame)
goto bad;
26078 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26079 PyTraceBack_Here(py_frame);
26081 Py_XDECREF(py_code);
26082 Py_XDECREF(py_frame);
26085 #if PY_MAJOR_VERSION < 3
26086 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26087 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26088 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26089 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26090 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26093 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26094 PyObject *obj = view->obj;
26096 if (PyObject_CheckBuffer(obj)) {
26097 PyBuffer_Release(view);
26109 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26111 int i, index, step, start;
26112 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26113 if (order ==
'F') {
26120 for (i = 0; i < ndim; i++) {
26121 index = start + step * i;
26122 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26124 itemsize *= mvs.shape[index];
26131 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26132 void **out_start,
void **out_end,
26133 int ndim,
size_t itemsize)
26137 start = end = slice->data;
26138 for (i = 0; i < ndim; i++) {
26139 Py_ssize_t stride = slice->strides[i];
26140 Py_ssize_t extent = slice->shape[i];
26142 *out_start = *out_end = start;
26146 end += stride * (extent - 1);
26148 start += stride * (extent - 1);
26151 *out_start = start;
26152 *out_end = end + itemsize;
26155 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26156 __Pyx_memviewslice *slice2,
26157 int ndim,
size_t itemsize)
26159 void *start1, *end1, *start2, *end2;
26160 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26161 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26162 return (start1 < end2) && (start2 < end1);
26166 static CYTHON_INLINE PyObject *
26167 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26170 #if PY_VERSION_HEX >= 0x02070000
26171 cobj = PyCapsule_New(p, sig, NULL);
26173 cobj = PyCObject_FromVoidPtr(p, NULL);
26179 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
26185 S.u32 = 0x01020304;
26186 return S.u8[0] == 4;
26190 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26191 __Pyx_BufFmt_StackElem* stack,
26192 __Pyx_TypeInfo* type) {
26193 stack[0].field = &ctx->root;
26194 stack[0].parent_offset = 0;
26195 ctx->root.type = type;
26196 ctx->root.name =
"buffer dtype";
26197 ctx->root.offset = 0;
26199 ctx->head->field = &ctx->root;
26200 ctx->fmt_offset = 0;
26201 ctx->head->parent_offset = 0;
26202 ctx->new_packmode =
'@';
26203 ctx->enc_packmode =
'@';
26204 ctx->new_count = 1;
26205 ctx->enc_count = 0;
26207 ctx->is_complex = 0;
26208 ctx->is_valid_array = 0;
26209 ctx->struct_alignment = 0;
26210 while (type->typegroup ==
'S') {
26212 ctx->head->field = type->fields;
26213 ctx->head->parent_offset = 0;
26214 type = type->fields->type;
26217 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
26219 const char* t = *ts;
26220 if (*t < '0' || *t >
'9') {
26223 count = *t++ -
'0';
26224 while (*t >=
'0' && *t <=
'9') {
26226 count += *t++ -
'0';
26232 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
26233 int number = __Pyx_BufFmt_ParseNumber(ts);
26235 PyErr_Format(PyExc_ValueError,\
26236 "Does not understand character buffer dtype format string ('%c')", **ts);
26239 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
26240 PyErr_Format(PyExc_ValueError,
26241 "Unexpected format string character: '%c'", ch);
26243 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
26245 case '?':
return "'bool'";
26246 case 'c':
return "'char'";
26247 case 'b':
return "'signed char'";
26248 case 'B':
return "'unsigned char'";
26249 case 'h':
return "'short'";
26250 case 'H':
return "'unsigned short'";
26251 case 'i':
return "'int'";
26252 case 'I':
return "'unsigned int'";
26253 case 'l':
return "'long'";
26254 case 'L':
return "'unsigned long'";
26255 case 'q':
return "'long long'";
26256 case 'Q':
return "'unsigned long long'";
26257 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
26258 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
26259 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
26260 case 'T':
return "a struct";
26261 case 'O':
return "Python object";
26262 case 'P':
return "a pointer";
26263 case 's':
case 'p':
return "a string";
26264 case 0:
return "end";
26265 default:
return "unparseable format string";
26268 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
26270 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26271 case 'h':
case 'H':
return 2;
26272 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
26273 case 'q':
case 'Q':
return 8;
26274 case 'f':
return (is_complex ? 8 : 4);
26275 case 'd':
return (is_complex ? 16 : 8);
26277 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
26280 case 'O':
case 'P':
return sizeof(
void*);
26282 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26286 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
26288 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26289 case 'h':
case 'H':
return sizeof(short);
26290 case 'i':
case 'I':
return sizeof(int);
26291 case 'l':
case 'L':
return sizeof(long);
26292 #ifdef HAVE_LONG_LONG
26293 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
26295 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
26296 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
26297 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
26298 case 'O':
case 'P':
return sizeof(
void*);
26300 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26305 typedef struct {
char c;
short x; } __Pyx_st_short;
26306 typedef struct {
char c;
int x; } __Pyx_st_int;
26307 typedef struct {
char c;
long x; } __Pyx_st_long;
26308 typedef struct {
char c;
float x; } __Pyx_st_float;
26309 typedef struct {
char c;
double x; } __Pyx_st_double;
26310 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
26311 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
26312 #ifdef HAVE_LONG_LONG
26313 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26315 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
26317 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26318 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
26319 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
26320 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
26321 #ifdef HAVE_LONG_LONG
26322 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
26324 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
26325 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
26326 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
26327 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
26329 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26337 typedef struct {
short x;
char c; } __Pyx_pad_short;
26338 typedef struct {
int x;
char c; } __Pyx_pad_int;
26339 typedef struct {
long x;
char c; } __Pyx_pad_long;
26340 typedef struct {
float x;
char c; } __Pyx_pad_float;
26341 typedef struct {
double x;
char c; } __Pyx_pad_double;
26342 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
26343 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
26344 #ifdef HAVE_LONG_LONG
26345 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
26347 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
26349 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26350 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
26351 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
26352 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
26353 #ifdef HAVE_LONG_LONG
26354 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
26356 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
26357 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
26358 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
26359 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
26361 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26365 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
26369 case 'b':
case 'h':
case 'i':
26370 case 'l':
case 'q':
case 's':
case 'p':
26372 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
26374 case 'f':
case 'd':
case 'g':
26375 return (is_complex ?
'C' :
'R');
26381 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26386 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26387 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26388 const char* expected;
26390 if (ctx->head == NULL) {
26394 expected = ctx->head->field->type->name;
26397 PyErr_Format(PyExc_ValueError,
26398 "Buffer dtype mismatch, expected %s%s%s but got %s",
26399 quote, expected, quote,
26400 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26402 __Pyx_StructField* field = ctx->head->field;
26403 __Pyx_StructField* parent = (ctx->head - 1)->field;
26404 PyErr_Format(PyExc_ValueError,
26405 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26406 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26407 parent->type->name, field->name);
26410 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26412 size_t size, offset, arraysize = 1;
26413 if (ctx->enc_type == 0)
return 0;
26414 if (ctx->head->field->type->arraysize[0]) {
26416 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
26417 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26419 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26420 PyErr_Format(PyExc_ValueError,
26421 "Expected a dimension of size %zu, got %zu",
26422 ctx->head->field->type->arraysize[0], ctx->enc_count);
26426 if (!ctx->is_valid_array) {
26427 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
26428 ctx->head->field->type->ndim, ndim);
26431 for (i = 0; i < ctx->head->field->type->ndim; i++) {
26432 arraysize *= ctx->head->field->type->arraysize[i];
26434 ctx->is_valid_array = 0;
26435 ctx->enc_count = 1;
26437 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26439 __Pyx_StructField* field = ctx->head->field;
26440 __Pyx_TypeInfo* type = field->type;
26441 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
26442 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26444 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26446 if (ctx->enc_packmode ==
'@') {
26447 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26448 size_t align_mod_offset;
26449 if (align_at == 0)
return -1;
26450 align_mod_offset = ctx->fmt_offset % align_at;
26451 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26452 if (ctx->struct_alignment == 0)
26453 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26456 if (type->size != size || type->typegroup != group) {
26457 if (type->typegroup ==
'C' && type->fields != NULL) {
26458 size_t parent_offset = ctx->head->parent_offset + field->offset;
26460 ctx->head->field = type->fields;
26461 ctx->head->parent_offset = parent_offset;
26464 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
26466 __Pyx_BufFmt_RaiseExpected(ctx);
26470 offset = ctx->head->parent_offset + field->offset;
26471 if (ctx->fmt_offset != offset) {
26472 PyErr_Format(PyExc_ValueError,
26473 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
26474 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26477 ctx->fmt_offset += size;
26479 ctx->fmt_offset += (arraysize - 1) * size;
26482 if (field == &ctx->root) {
26484 if (ctx->enc_count != 0) {
26485 __Pyx_BufFmt_RaiseExpected(ctx);
26490 ctx->head->field = ++field;
26491 if (field->type == NULL) {
26493 field = ctx->head->field;
26495 }
else if (field->type->typegroup ==
'S') {
26496 size_t parent_offset = ctx->head->parent_offset + field->offset;
26497 if (field->type->fields->type == NULL)
continue;
26498 field = field->type->fields;
26500 ctx->head->field = field;
26501 ctx->head->parent_offset = parent_offset;
26507 }
while (ctx->enc_count);
26509 ctx->is_complex = 0;
26513 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
26515 const char *ts = *tsp;
26516 int i = 0, number, ndim;
26518 if (ctx->new_count != 1) {
26519 PyErr_SetString(PyExc_ValueError,
26520 "Cannot handle repeated arrays in format string");
26523 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26524 ndim = ctx->head->field->type->ndim;
26525 while (*ts && *ts !=
')') {
26527 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
26530 number = __Pyx_BufFmt_ExpectNumber(&ts);
26531 if (number == -1)
return NULL;
26532 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
26533 return PyErr_Format(PyExc_ValueError,
26534 "Expected a dimension of size %zu, got %d",
26535 ctx->head->field->type->arraysize[i], number);
26536 if (*ts !=
',' && *ts !=
')')
26537 return PyErr_Format(PyExc_ValueError,
26538 "Expected a comma in format string, got '%c'", *ts);
26539 if (*ts ==
',') ts++;
26543 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
26544 ctx->head->field->type->ndim, i);
26546 PyErr_SetString(PyExc_ValueError,
26547 "Unexpected end of format string, expected ')'");
26550 ctx->is_valid_array = 1;
26551 ctx->new_count = 1;
26555 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
26560 if (ctx->enc_type != 0 && ctx->head == NULL) {
26561 __Pyx_BufFmt_RaiseExpected(ctx);
26564 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26565 if (ctx->head != NULL) {
26566 __Pyx_BufFmt_RaiseExpected(ctx);
26576 if (!__Pyx_Is_Little_Endian()) {
26577 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
26580 ctx->new_packmode =
'=';
26585 if (__Pyx_Is_Little_Endian()) {
26586 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
26589 ctx->new_packmode =
'=';
26595 ctx->new_packmode = *ts++;
26599 const char* ts_after_sub;
26600 size_t i, struct_count = ctx->new_count;
26601 size_t struct_alignment = ctx->struct_alignment;
26602 ctx->new_count = 1;
26605 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
26608 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26610 ctx->enc_count = 0;
26611 ctx->struct_alignment = 0;
26614 for (i = 0; i != struct_count; ++i) {
26615 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26616 if (!ts_after_sub)
return NULL;
26619 if (struct_alignment) ctx->struct_alignment = struct_alignment;
26624 size_t alignment = ctx->struct_alignment;
26626 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26628 if (alignment && ctx->fmt_offset % alignment) {
26629 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26634 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26635 ctx->fmt_offset += ctx->new_count;
26636 ctx->new_count = 1;
26637 ctx->enc_count = 0;
26639 ctx->enc_packmode = ctx->new_packmode;
26645 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
26646 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
26649 CYTHON_FALLTHROUGH;
26650 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
26651 case 'l':
case 'L':
case 'q':
case 'Q':
26652 case 'f':
case 'd':
case 'g':
26653 case 'O':
case 'p':
26654 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
26655 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
26656 ctx->enc_count += ctx->new_count;
26657 ctx->new_count = 1;
26662 CYTHON_FALLTHROUGH;
26664 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26665 ctx->enc_count = ctx->new_count;
26666 ctx->enc_packmode = ctx->new_packmode;
26667 ctx->enc_type = *ts;
26668 ctx->is_complex = got_Z;
26670 ctx->new_count = 1;
26675 while(*ts !=
':') ++ts;
26679 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
26683 int number = __Pyx_BufFmt_ExpectNumber(&ts);
26684 if (number == -1)
return NULL;
26685 ctx->new_count = (size_t)number;
26693 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26700 if (a->size != b->size || a->typegroup != b->typegroup ||
26701 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26702 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
26703 return a->size == b->size;
26709 for (i = 0; i < a->ndim; i++)
26710 if (a->arraysize[i] != b->arraysize[i])
26713 if (a->typegroup ==
'S') {
26714 if (a->flags != b->flags)
26716 if (a->fields || b->fields) {
26717 if (!(a->fields && b->fields))
26719 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26720 __Pyx_StructField *field_a = a->fields + i;
26721 __Pyx_StructField *field_b = b->fields + i;
26722 if (field_a->offset != field_b->offset ||
26723 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26726 return !a->fields[i].type && !b->fields[i].type;
26734 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
26736 if (buf->shape[dim] <= 1)
26738 if (buf->strides) {
26739 if (spec & __Pyx_MEMVIEW_CONTIG) {
26740 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26741 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
26742 PyErr_Format(PyExc_ValueError,
26743 "Buffer is not indirectly contiguous "
26744 "in dimension %d.", dim);
26747 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
26748 PyErr_SetString(PyExc_ValueError,
26749 "Buffer and memoryview are not contiguous "
26750 "in the same dimension.");
26754 if (spec & __Pyx_MEMVIEW_FOLLOW) {
26755 Py_ssize_t stride = buf->strides[dim];
26758 if (unlikely(stride < buf->itemsize)) {
26759 PyErr_SetString(PyExc_ValueError,
26760 "Buffer and memoryview are not contiguous "
26761 "in the same dimension.");
26766 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
26767 PyErr_Format(PyExc_ValueError,
26768 "C-contiguous buffer is not contiguous in "
26769 "dimension %d", dim);
26771 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
26772 PyErr_Format(PyExc_ValueError,
26773 "C-contiguous buffer is not indirect in "
26774 "dimension %d", dim);
26776 }
else if (unlikely(buf->suboffsets)) {
26777 PyErr_SetString(PyExc_ValueError,
26778 "Buffer exposes suboffsets but no strides");
26787 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
26789 if (spec & __Pyx_MEMVIEW_DIRECT) {
26790 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
26791 PyErr_Format(PyExc_ValueError,
26792 "Buffer not compatible with direct access "
26793 "in dimension %d.", dim);
26797 if (spec & __Pyx_MEMVIEW_PTR) {
26798 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
26799 PyErr_Format(PyExc_ValueError,
26800 "Buffer is not indirectly accessible "
26801 "in dimension %d.", dim);
26810 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
26813 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26814 Py_ssize_t stride = 1;
26815 for (i = 0; i < ndim; i++) {
26816 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26817 PyErr_SetString(PyExc_ValueError,
26818 "Buffer not fortran contiguous.");
26821 stride = stride * buf->shape[i];
26823 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26824 Py_ssize_t stride = 1;
26825 for (i = ndim - 1; i >- 1; i--) {
26826 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26827 PyErr_SetString(PyExc_ValueError,
26828 "Buffer not C contiguous.");
26831 stride = stride * buf->shape[i];
26838 static int __Pyx_ValidateAndInit_memviewslice(
26843 __Pyx_TypeInfo *dtype,
26844 __Pyx_BufFmt_StackElem stack[],
26845 __Pyx_memviewslice *memviewslice,
26846 PyObject *original_obj)
26848 struct __pyx_memoryview_obj *memview, *new_memview;
26849 __Pyx_RefNannyDeclarations
26851 int i, spec = 0, retval = -1;
26852 __Pyx_BufFmt_Context ctx;
26853 int from_memoryview = __pyx_memoryview_check(original_obj);
26854 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
26855 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
26856 original_obj)->typeinfo)) {
26857 memview = (
struct __pyx_memoryview_obj *) original_obj;
26858 new_memview = NULL;
26860 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26861 original_obj, buf_flags, 0, dtype);
26862 new_memview = memview;
26863 if (unlikely(!memview))
26866 buf = &memview->view;
26867 if (unlikely(buf->ndim != ndim)) {
26868 PyErr_Format(PyExc_ValueError,
26869 "Buffer has wrong number of dimensions (expected %d, got %d)",
26874 __Pyx_BufFmt_Init(&ctx, stack, dtype);
26875 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
26877 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
26878 PyErr_Format(PyExc_ValueError,
26879 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
26880 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
26882 (buf->itemsize > 1) ?
"s" :
"",
26885 (dtype->size > 1) ?
"s" :
"");
26888 if (buf->len > 0) {
26889 for (i = 0; i < ndim; i++) {
26890 spec = axes_specs[i];
26891 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
26893 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26896 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26899 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26900 new_memview != NULL) == -1)) {
26906 Py_XDECREF(new_memview);
26909 __Pyx_RefNannyFinishContext();
26914 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
26915 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26916 __Pyx_BufFmt_StackElem stack[1];
26917 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26919 if (obj == Py_None) {
26920 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26923 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26924 PyBUF_RECORDS_RO | writable_flag, 1,
26925 &__Pyx_TypeInfo_float, stack,
26927 if (unlikely(retcode == -1))
26931 result.memview = NULL;
26932 result.data = NULL;
26937 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
26938 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26939 __Pyx_BufFmt_StackElem stack[1];
26940 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26942 if (obj == Py_None) {
26943 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26946 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26947 PyBUF_RECORDS_RO | writable_flag, 1,
26948 &__Pyx_TypeInfo_double, stack,
26950 if (unlikely(retcode == -1))
26954 result.memview = NULL;
26955 result.data = NULL;
26960 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj,
int writable_flag) {
26961 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26962 __Pyx_BufFmt_StackElem stack[1];
26963 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26965 if (obj == Py_None) {
26966 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26969 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26970 PyBUF_RECORDS_RO | writable_flag, 1,
26971 &__Pyx_TypeInfo_long__double, stack,
26973 if (unlikely(retcode == -1))
26977 result.memview = NULL;
26978 result.data = NULL;
26983 static __Pyx_memviewslice
26984 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
26985 const char *mode,
int ndim,
26986 size_t sizeof_dtype,
int contig_flag,
26987 int dtype_is_object)
26989 __Pyx_RefNannyDeclarations
26991 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26992 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26993 Py_buffer *buf = &from_memview->view;
26994 PyObject *shape_tuple = NULL;
26995 PyObject *temp_int = NULL;
26996 struct __pyx_array_obj *array_obj = NULL;
26997 struct __pyx_memoryview_obj *memview_obj = NULL;
26998 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
26999 for (i = 0; i < ndim; i++) {
27000 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27001 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
27002 "indirect dimensions (axis %d)", i);
27006 shape_tuple = PyTuple_New(ndim);
27007 if (unlikely(!shape_tuple)) {
27010 __Pyx_GOTREF(shape_tuple);
27011 for(i = 0; i < ndim; i++) {
27012 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27013 if(unlikely(!temp_int)) {
27016 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27020 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
27021 if (unlikely(!array_obj)) {
27024 __Pyx_GOTREF(array_obj);
27025 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27026 (PyObject *) array_obj, contig_flag,
27028 from_mvs->memview->typeinfo);
27029 if (unlikely(!memview_obj))
27031 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27033 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27034 dtype_is_object) < 0))
27038 __Pyx_XDECREF(new_mvs.memview);
27039 new_mvs.memview = NULL;
27040 new_mvs.data = NULL;
27042 __Pyx_XDECREF(shape_tuple);
27043 __Pyx_XDECREF(temp_int);
27044 __Pyx_XDECREF(array_obj);
27045 __Pyx_RefNannyFinishContext();
27050 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27051 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27052 #pragma GCC diagnostic push
27053 #pragma GCC diagnostic ignored "-Wconversion"
27055 const int neg_one = (int) -1, const_zero = (
int) 0;
27056 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27057 #pragma GCC diagnostic pop
27059 const int is_unsigned = neg_one > const_zero;
27061 if (
sizeof(
int) <
sizeof(long)) {
27062 return PyInt_FromLong((
long) value);
27063 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27064 return PyLong_FromUnsignedLong((
unsigned long) value);
27065 #ifdef HAVE_LONG_LONG
27066 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27067 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27071 if (
sizeof(
int) <=
sizeof(
long)) {
27072 return PyInt_FromLong((
long) value);
27073 #ifdef HAVE_LONG_LONG
27074 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27075 return PyLong_FromLongLong((PY_LONG_LONG) value);
27080 int one = 1;
int little = (int)*(
unsigned char *)&one;
27081 unsigned char *bytes = (
unsigned char *)&value;
27082 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27083 little, !is_unsigned);
27088 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27089 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27090 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27091 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27092 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27094 func_type value = func_value;\
27095 if (sizeof(target_type) < sizeof(func_type)) {\
27096 if (unlikely(value != (func_type) (target_type) value)) {\
27097 func_type zero = 0;\
27098 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27099 return (target_type) -1;\
27100 if (is_unsigned && unlikely(value < zero))\
27101 goto raise_neg_overflow;\
27103 goto raise_overflow;\
27106 return (target_type) value;\
27110 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27111 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27112 #pragma GCC diagnostic push
27113 #pragma GCC diagnostic ignored "-Wconversion"
27115 const int neg_one = (int) -1, const_zero = (
int) 0;
27116 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27117 #pragma GCC diagnostic pop
27119 const int is_unsigned = neg_one > const_zero;
27120 #if PY_MAJOR_VERSION < 3
27121 if (likely(PyInt_Check(x))) {
27122 if (
sizeof(
int) <
sizeof(long)) {
27123 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27125 long val = PyInt_AS_LONG(x);
27126 if (is_unsigned && unlikely(val < 0)) {
27127 goto raise_neg_overflow;
27133 if (likely(PyLong_Check(x))) {
27135 #if CYTHON_USE_PYLONG_INTERNALS
27136 const digit* digits = ((PyLongObject*)x)->ob_digit;
27137 switch (Py_SIZE(x)) {
27138 case 0:
return (
int) 0;
27139 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27141 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27142 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27143 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27144 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27145 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27150 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27151 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27152 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27153 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27154 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27159 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27160 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27161 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27162 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27163 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27169 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27170 if (unlikely(Py_SIZE(x) < 0)) {
27171 goto raise_neg_overflow;
27175 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27176 if (unlikely(result < 0))
27178 if (unlikely(result == 1))
27179 goto raise_neg_overflow;
27182 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27183 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27184 #ifdef HAVE_LONG_LONG
27185 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27186 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27190 #if CYTHON_USE_PYLONG_INTERNALS
27191 const digit* digits = ((PyLongObject*)x)->ob_digit;
27192 switch (Py_SIZE(x)) {
27193 case 0:
return (
int) 0;
27194 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27195 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27197 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27198 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27199 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27200 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27201 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27206 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27207 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27208 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27209 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27210 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27215 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27216 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27217 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27218 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27219 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27224 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27225 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27226 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27227 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27228 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27233 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27234 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27235 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27236 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27237 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27242 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27243 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27244 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27245 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27246 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27252 if (
sizeof(
int) <=
sizeof(long)) {
27253 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27254 #ifdef HAVE_LONG_LONG
27255 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27256 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27261 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27262 PyErr_SetString(PyExc_RuntimeError,
27263 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27266 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27267 #if PY_MAJOR_VERSION < 3
27268 if (likely(v) && !PyLong_Check(v)) {
27270 v = PyNumber_Long(tmp);
27275 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27276 unsigned char *bytes = (
unsigned char *)&val;
27277 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27278 bytes,
sizeof(val),
27279 is_little, !is_unsigned);
27289 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27290 if (!tmp)
return (
int) -1;
27291 val = __Pyx_PyInt_As_int(tmp);
27296 PyErr_SetString(PyExc_OverflowError,
27297 "value too large to convert to int");
27299 raise_neg_overflow:
27300 PyErr_SetString(PyExc_OverflowError,
27301 "can't convert negative value to int");
27306 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
27307 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27308 #pragma GCC diagnostic push
27309 #pragma GCC diagnostic ignored "-Wconversion"
27311 const long neg_one = (long) -1, const_zero = (
long) 0;
27312 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27313 #pragma GCC diagnostic pop
27315 const int is_unsigned = neg_one > const_zero;
27316 #if PY_MAJOR_VERSION < 3
27317 if (likely(PyInt_Check(x))) {
27318 if (
sizeof(
long) <
sizeof(long)) {
27319 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
27321 long val = PyInt_AS_LONG(x);
27322 if (is_unsigned && unlikely(val < 0)) {
27323 goto raise_neg_overflow;
27329 if (likely(PyLong_Check(x))) {
27331 #if CYTHON_USE_PYLONG_INTERNALS
27332 const digit* digits = ((PyLongObject*)x)->ob_digit;
27333 switch (Py_SIZE(x)) {
27334 case 0:
return (
long) 0;
27335 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
27337 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27338 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27339 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27340 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
27341 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27346 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27347 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27348 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27349 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
27350 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27355 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27356 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27357 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27358 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
27359 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27365 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27366 if (unlikely(Py_SIZE(x) < 0)) {
27367 goto raise_neg_overflow;
27371 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27372 if (unlikely(result < 0))
27374 if (unlikely(result == 1))
27375 goto raise_neg_overflow;
27378 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27379 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
27380 #ifdef HAVE_LONG_LONG
27381 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27382 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27386 #if CYTHON_USE_PYLONG_INTERNALS
27387 const digit* digits = ((PyLongObject*)x)->ob_digit;
27388 switch (Py_SIZE(x)) {
27389 case 0:
return (
long) 0;
27390 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
27391 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
27393 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
27394 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27395 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27396 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27397 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27402 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27403 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27404 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27405 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27406 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27411 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27412 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27413 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27414 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27415 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27420 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27421 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27422 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27423 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27424 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27429 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27430 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27431 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27432 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27433 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27438 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27439 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27440 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27441 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27442 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27448 if (
sizeof(
long) <=
sizeof(long)) {
27449 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
27450 #ifdef HAVE_LONG_LONG
27451 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27452 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27457 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27458 PyErr_SetString(PyExc_RuntimeError,
27459 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27462 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27463 #if PY_MAJOR_VERSION < 3
27464 if (likely(v) && !PyLong_Check(v)) {
27466 v = PyNumber_Long(tmp);
27471 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27472 unsigned char *bytes = (
unsigned char *)&val;
27473 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27474 bytes,
sizeof(val),
27475 is_little, !is_unsigned);
27485 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27486 if (!tmp)
return (
long) -1;
27487 val = __Pyx_PyInt_As_long(tmp);
27492 PyErr_SetString(PyExc_OverflowError,
27493 "value too large to convert to long");
27495 raise_neg_overflow:
27496 PyErr_SetString(PyExc_OverflowError,
27497 "can't convert negative value to long");
27502 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27503 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27504 #pragma GCC diagnostic push
27505 #pragma GCC diagnostic ignored "-Wconversion"
27507 const long neg_one = (long) -1, const_zero = (
long) 0;
27508 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27509 #pragma GCC diagnostic pop
27511 const int is_unsigned = neg_one > const_zero;
27513 if (
sizeof(
long) <
sizeof(long)) {
27514 return PyInt_FromLong((
long) value);
27515 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27516 return PyLong_FromUnsignedLong((
unsigned long) value);
27517 #ifdef HAVE_LONG_LONG
27518 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27519 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27523 if (
sizeof(
long) <=
sizeof(
long)) {
27524 return PyInt_FromLong((
long) value);
27525 #ifdef HAVE_LONG_LONG
27526 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27527 return PyLong_FromLongLong((PY_LONG_LONG) value);
27532 int one = 1;
int little = (int)*(
unsigned char *)&one;
27533 unsigned char *bytes = (
unsigned char *)&value;
27534 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27535 little, !is_unsigned);
27540 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
27541 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27542 #pragma GCC diagnostic push
27543 #pragma GCC diagnostic ignored "-Wconversion"
27545 const char neg_one = (char) -1, const_zero = (
char) 0;
27546 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27547 #pragma GCC diagnostic pop
27549 const int is_unsigned = neg_one > const_zero;
27550 #if PY_MAJOR_VERSION < 3
27551 if (likely(PyInt_Check(x))) {
27552 if (
sizeof(
char) <
sizeof(long)) {
27553 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
27555 long val = PyInt_AS_LONG(x);
27556 if (is_unsigned && unlikely(val < 0)) {
27557 goto raise_neg_overflow;
27563 if (likely(PyLong_Check(x))) {
27565 #if CYTHON_USE_PYLONG_INTERNALS
27566 const digit* digits = ((PyLongObject*)x)->ob_digit;
27567 switch (Py_SIZE(x)) {
27568 case 0:
return (
char) 0;
27569 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
27571 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27572 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27573 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27574 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
27575 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27580 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27581 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27582 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27583 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
27584 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27589 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27590 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27591 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27592 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
27593 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27599 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27600 if (unlikely(Py_SIZE(x) < 0)) {
27601 goto raise_neg_overflow;
27605 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27606 if (unlikely(result < 0))
27608 if (unlikely(result == 1))
27609 goto raise_neg_overflow;
27612 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
27613 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
27614 #ifdef HAVE_LONG_LONG
27615 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
27616 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27620 #if CYTHON_USE_PYLONG_INTERNALS
27621 const digit* digits = ((PyLongObject*)x)->ob_digit;
27622 switch (Py_SIZE(x)) {
27623 case 0:
return (
char) 0;
27624 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
27625 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
27627 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
27628 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27629 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27630 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27631 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27636 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27637 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27638 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27639 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27640 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27645 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27646 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27647 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27648 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27649 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27654 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27655 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27656 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27657 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27658 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27663 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27664 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27665 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27666 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27667 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27672 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27673 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27674 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27675 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27676 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27682 if (
sizeof(
char) <=
sizeof(long)) {
27683 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
27684 #ifdef HAVE_LONG_LONG
27685 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
27686 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
27691 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27692 PyErr_SetString(PyExc_RuntimeError,
27693 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27696 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27697 #if PY_MAJOR_VERSION < 3
27698 if (likely(v) && !PyLong_Check(v)) {
27700 v = PyNumber_Long(tmp);
27705 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27706 unsigned char *bytes = (
unsigned char *)&val;
27707 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27708 bytes,
sizeof(val),
27709 is_little, !is_unsigned);
27719 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27720 if (!tmp)
return (
char) -1;
27721 val = __Pyx_PyInt_As_char(tmp);
27726 PyErr_SetString(PyExc_OverflowError,
27727 "value too large to convert to char");
27729 raise_neg_overflow:
27730 PyErr_SetString(PyExc_OverflowError,
27731 "can't convert negative value to char");
27736 static int __Pyx_check_binary_version(
void) {
27738 int same=1, i, found_dot;
27739 const char* rt_from_call = Py_GetVersion();
27740 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27742 for (i = 0; i < 4; i++) {
27743 if (!ctversion[i]) {
27744 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
27747 if (rt_from_call[i] != ctversion[i]) {
27753 char rtversion[5] = {
'\0'};
27755 for (i=0; i<4; ++i) {
27756 if (rt_from_call[i] ==
'.') {
27757 if (found_dot)
break;
27759 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
27762 rtversion[i] = rt_from_call[i];
27764 PyOS_snprintf(message,
sizeof(message),
27765 "compiletime version %s of module '%.100s' "
27766 "does not match runtime version %s",
27767 ctversion, __Pyx_MODULE_NAME, rtversion);
27768 return PyErr_WarnEx(NULL, message, 1);
27774 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27776 #if PY_MAJOR_VERSION < 3
27777 if (t->is_unicode) {
27778 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27779 }
else if (t->intern) {
27780 *t->p = PyString_InternFromString(t->s);
27782 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27785 if (t->is_unicode | t->is_str) {
27787 *t->p = PyUnicode_InternFromString(t->s);
27788 }
else if (t->encoding) {
27789 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27791 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27794 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27799 if (PyObject_Hash(*t->p) == -1)
27806 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
27807 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27809 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
27811 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27813 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27814 #if !CYTHON_PEP393_ENABLED
27815 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27817 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27818 if (!defenc)
return NULL;
27819 defenc_c = PyBytes_AS_STRING(defenc);
27820 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27822 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27824 for (c = defenc_c; c < end; c++) {
27825 if ((
unsigned char) (*c) >= 128) {
27826 PyUnicode_AsASCIIString(o);
27832 *length = PyBytes_GET_SIZE(defenc);
27836 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27837 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
27838 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27839 if (likely(PyUnicode_IS_ASCII(o))) {
27840 *length = PyUnicode_GET_LENGTH(o);
27841 return PyUnicode_AsUTF8(o);
27843 PyUnicode_AsASCIIString(o);
27847 return PyUnicode_AsUTF8AndSize(o, length);
27852 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27853 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27855 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27856 __Pyx_sys_getdefaultencoding_not_ascii &&
27858 PyUnicode_Check(o)) {
27859 return __Pyx_PyUnicode_AsStringAndSize(o, length);
27862 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27863 if (PyByteArray_Check(o)) {
27864 *length = PyByteArray_GET_SIZE(o);
27865 return PyByteArray_AS_STRING(o);
27870 int r = PyBytes_AsStringAndSize(o, &result, length);
27871 if (unlikely(r < 0)) {
27878 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
27879 int is_true = x == Py_True;
27880 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
27881 else return PyObject_IsTrue(x);
27883 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27885 if (unlikely(!x))
return -1;
27886 retval = __Pyx_PyObject_IsTrue(x);
27890 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
27891 #if PY_MAJOR_VERSION >= 3
27892 if (PyLong_Check(result)) {
27893 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27894 "__int__ returned non-int (type %.200s). "
27895 "The ability to return an instance of a strict subclass of int "
27896 "is deprecated, and may be removed in a future version of Python.",
27897 Py_TYPE(result)->tp_name)) {
27904 PyErr_Format(PyExc_TypeError,
27905 "__%.4s__ returned non-%.4s (type %.200s)",
27906 type_name, type_name, Py_TYPE(result)->tp_name);
27910 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27911 #if CYTHON_USE_TYPE_SLOTS
27912 PyNumberMethods *m;
27914 const char *name = NULL;
27915 PyObject *res = NULL;
27916 #if PY_MAJOR_VERSION < 3
27917 if (likely(PyInt_Check(x) || PyLong_Check(x)))
27919 if (likely(PyLong_Check(x)))
27921 return __Pyx_NewRef(x);
27922 #if CYTHON_USE_TYPE_SLOTS
27923 m = Py_TYPE(x)->tp_as_number;
27924 #if PY_MAJOR_VERSION < 3
27925 if (m && m->nb_int) {
27927 res = m->nb_int(x);
27929 else if (m && m->nb_long) {
27931 res = m->nb_long(x);
27934 if (likely(m && m->nb_int)) {
27936 res = m->nb_int(x);
27940 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27941 res = PyNumber_Int(x);
27945 #if PY_MAJOR_VERSION < 3
27946 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27948 if (unlikely(!PyLong_CheckExact(res))) {
27950 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27953 else if (!PyErr_Occurred()) {
27954 PyErr_SetString(PyExc_TypeError,
27955 "an integer is required");
27959 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27962 #if PY_MAJOR_VERSION < 3
27963 if (likely(PyInt_CheckExact(b))) {
27964 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
27965 return PyInt_AS_LONG(b);
27967 return PyInt_AsSsize_t(b);
27970 if (likely(PyLong_CheckExact(b))) {
27971 #if CYTHON_USE_PYLONG_INTERNALS
27972 const digit* digits = ((PyLongObject*)b)->ob_digit;
27973 const Py_ssize_t size = Py_SIZE(b);
27974 if (likely(__Pyx_sst_abs(size) <= 1)) {
27975 ival = likely(size) ? digits[0] : 0;
27976 if (size == -1) ival = -ival;
27981 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27982 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27986 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27987 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27991 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27992 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27996 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27997 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28001 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28002 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28006 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28007 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28013 return PyLong_AsSsize_t(b);
28015 x = PyNumber_Index(b);
28017 ival = PyInt_AsSsize_t(x);
28021 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
28022 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
28023 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
28024 #if PY_MAJOR_VERSION < 3
28025 }
else if (likely(PyInt_CheckExact(o))) {
28026 return PyInt_AS_LONG(o);
28031 x = PyNumber_Index(o);
28033 ival = PyInt_AsLong(x);
28038 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28039 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28041 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28042 return PyInt_FromSize_t(ival);
Base class for linear operators. This class serves as interface for all derived classes.